Wrapper functions for API of ForwardDiff.jl
at
http://www.juliadiff.org/ForwardDiff.jl/stable/user/api.html.
These functions can help you calculate derivative, gradient, jacobian and hessian
for your functions using forward mode automatic differentiation.
For more details, see http://www.juliadiff.org/ForwardDiff.jl/stable/user/api.html.
forward_deriv(f, x) forward_grad_config(f, x, chunk_size = NULL, diffresult = NULL) forward_jacobian_config(f, x, chunk_size = NULL, diffresult = NULL) forward_hessian_config(f, x, chunk_size = NULL, diffresult = NULL) forward_grad(f, x, cfg = NULL, check = TRUE, diffresult = NULL, debug = TRUE) forward_jacobian(f, x, cfg = NULL, check = TRUE, diffresult = NULL, debug = TRUE) forward_hessian(f, x, cfg = NULL, check = TRUE, diffresult = NULL, debug = TRUE)
f | the function you want to calulate the derivative, gradient and etc.
Note that |
---|---|
x | the point where you take the derivative, gradient and etc.
Note that it should be a scalar for |
chunk_size | the size of the chunk to construct the Config objects for |
diffresult | Optional DiffResult object to store the derivative information. |
cfg | Config object which have
information useful to do automatic differentiation for |
check | whether to allow tag checking.
Set check to |
debug | Whether to use the wrapper functions under debug mode. With the debug mode, users can have more informative error messages. Without the debug mode, the wrapper functions will be more performant. |
forward_deriv
, forward_grad
, forward_jacobian
and forward_hessian
return
the derivative, gradient, jacobian and hessian of f
correspondingly evaluated at x
.
forward_grad_config
, forward_jacobian_config
and forward_hessian_config
return Config instances based on f`` and
x`,
which contain all the work buffers required to carry out the forward mode automatic differentiation.