TuckerTensorTrain.entries_derivatives#
- t3toolbox.tucker_tensor_train.TuckerTensorTrain.entries_derivatives(index, pp, order)#
def entries_derivatives( self, index: NDArray, # int, shape=(d,)+W -- grid points pp: Sequence[NDArray], # perturbation vectors P, len=d, elm_shape=W+(Ni,) order: int, # highest derivative order ) -> NDArray: # shape=(order+1,)+W+C
Symmetric directional derivatives of this T3’s entries at
index, in directionP.The Taylor data of the represented tensor’s multilinear extension at grid corner
index, in directionP:y^(t) = d^t/ds^t apply(e_{index} + s P)|_0. Index0is the ordinaryentries(). Stacksorder + W + C.indexandPshareW.Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> np.random.seed(0) >>> x = t3.TuckerTensorTrain.randn((14, 15, 16), (4, 5, 6), (1, 3, 2, 1)) >>> index = np.array([3, 5, 7]) >>> pp = (np.random.randn(14), np.random.randn(15), np.random.randn(16)) >>> yj = x.entries_derivatives(index, pp, 3) >>> print(yj.shape) (4,) >>> print(bool(np.allclose(yj[0], x.entries(index)))) # order 0 == entries True