UT3Tangent.probe#
- t3toolbox.uniform_manifold.UT3Tangent.probe(ww)#
def probe( self, ww: typ.Sequence[NDArray], # probe vectors, len=d, ith elm_shape=W+(Ni,) ) -> typ.Tuple[NDArray, ...]: # d probes, ith elm_shape=W+K+C+(Ni,)
Probe this tangent vector: the single-sample Riemannian Jacobian
𝒥(contract all-but-one mode, for each mode). Uniform mirror ofprobe();wwis packed at the boundary and thedprobes come back as ragged-width vectors, stackedW+K+C. The bare𝒥(no gauge projectorΠ).Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> import t3toolbox.uniform_manifold as ut3m >>> import t3toolbox.backend.probing as t3p >>> np.random.seed(0) >>> x = ut3.UniformTuckerTensorTrain.from_t3(t3.TuckerTensorTrain.randn((10, 11, 12), (5, 6, 4), (1, 2, 3, 1))) >>> v = ut3m.UNIFORM_COREWISE.randn(ut3m.UNIFORM_MANIFOLD.frame(x)) >>> ww = (np.random.randn(2, 10), np.random.randn(2, 11), np.random.randn(2, 12)) # probe stack W=(2,) >>> zz = v.probe(ww) >>> print(zz[0].shape) # W + K + C + (N0,) = (2,) + () + () + (10,) (2, 10) >>> print(bool(max(float(np.linalg.norm(a - b)) ... for a, b in zip(zz, t3p.dense_probe(ww, v.to_dense()))) < 1e-9)) # dense reference True