T3Tangent.entries#

t3toolbox.manifold.T3Tangent.entries(index)#
def entries(
        self,
        index:      NDArray,  # int, shape=(d,)+W (a stack W of multi-indices)
) -> NDArray:                 # entries of the dense tangent at ``index``; shape=W+K+C

Extract entries of the dense tangent at index (without forming the dense tangent).

The tangent analogue of TuckerTensorTrain.entries(), and the all-modes special case of probe() with unit vectors – computed by slicing Tucker-core fibers (no contraction, no N factor), then the same left-to-right sweep as apply(). index is (d,) + W: index[m] holds the (stack W of) indices into mode m. Result stacked W + K + C.

See also

apply, probe

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.frame_variations_format as bvf
>>> import t3toolbox.manifold as t3m
>>> x = t3.TuckerTensorTrain.randn((10, 11, 12), (5, 6, 4), (1, 2, 3, 1))
>>> frame, variations = bvf.t3_orthogonal_representations(x)
>>> v = t3m.T3Tangent(frame, variations)
>>> idx = (3, 5, 7)
>>> print(bool(abs(float(v.entries(idx)) - float(v.to_dense()[idx])) < 1e-9))
True
Parameters:

index (NDArray)

Return type:

NDArray