autodiff: Calculate Gradient, Jacobian and Hessian using Automatic...

Description Usage Arguments Value

Description

These functions calculate gradient, jacobian or hessian for the target function.

Usage

1
2
3
4
5
6
7
ad_jacobian(func, x, ..., mode = c("reverse", "forward"), debug = TRUE)

ad_hessian(func, x, ..., mode = c("reverse", "forward"), debug = TRUE)

ad_grad(func, x, ..., mode = c("reverse", "forward"), debug = TRUE)

ad_deriv(func, x, ..., mode = c("reverse", "forward"), debug = TRUE)

Arguments

func

the target function to calculate gradient, jacobian or hessian.

x

the input(s) where derivative is (are) taken.

...

other arguments passed to the target function func.

mode

whether to use forward or reverse mode automatic differentiation.

debug

Whether to activate debug mode. With the debug mode, users can have more informative error messages. Without the debug mode, the functions will be more performant.

Value

if x is given, then return will be derivatives; if x is not given, then return will be a function to calculate derivatives.


Non-Contradiction/autodiffr documentation built on May 10, 2019, 8:04 a.m.