Overview
The numeric gradient is a set of algorithms that are used to compute the gradient of a function.
The gradient is a vector of partial derivatives of the function.
{%
\begin{bmatrix}
\frac{\partial{f}}{\partial{x_1}} \\
... \\
\frac{\partial{f}}{\partial{x_n}} \\
\end{bmatrix}
%}
Gradient API
The gradient api provides methods for calculating the gradient of a function.
The following demonstrates a simple example of using the gradient library.
let gd= await import('/lib/numeric/differentiation/v1.0.0/gradient.mjs');
let dv = await import('/lib/numeric/differentiation/v1.0.0/derivative.mjs');
let f = function(x,y){
return x + 3*y + 5;
}
let test = gd.gradient(f, [0,0], dv.backwardDifference);