pwtools.rbf.core.Rbf.deriv

Rbf.deriv(points)[source]

Analytic first partial derivatives.

Analytic reference implementation of jax grad for 1d input or vmap(grad) for 2d input.

>>> x.shape
(n,)
>>> grad(f)(x).shape
(n,)
>>> X.shape
(m,n)
>>> vmap(grad(self))(X).shape
(m,n)
Parameters:

points (2d array (L,N) or (N,)) –

Returns:

Each row holds the gradient vector \(\partial f/\partial\mathbf x_i\) where \(\mathbf x_i = \texttt{points[i,:] = [xi_0, ..., xi_N-1]}\). For all points points (L,N) we get the matrix:

[[df/dx0_0,   df/dx0_1,   ..., df/dx0_N-1],
 [...],
 [df/dxL-1_0, df/dxL-1_1, ..., df/dxL-1_N-1]]

Return type:

2d array (L,N) or (N,)

See also

deriv_jax()