numdifftools.nd_algopy.Gradient¶
-
class
numdifftools.nd_algopy.
Gradient
(f, n=1, method='forward', full_output=False)[source][source]¶ Calculate Gradient with Algorithmic Differentiation method
Parameters: f : function
function of one array f(x, *args, **kwds)
method : string, optional {‘forward’, ‘reverse’}
defines method used in the approximation
Returns: grad : array
gradient
See also
Notes
Algorithmic differentiation is a set of techniques to numerically evaluate the derivative of a function specified by a computer program. AD exploits the fact that every computer program, no matter how complicated, executes a sequence of elementary arithmetic operations (addition, subtraction, multiplication, division, etc.) and elementary functions (exp, log, sin, cos, etc.). By applying the chain rule repeatedly to these operations, derivatives of arbitrary order can be computed automatically, accurately to working precision, and using at most a small constant factor more arithmetic operations than the original program.
Methods
__init__
(f[, n, method, full_output])computational_graph
(x, *args, **kwds)Attributes
f