CorewiseGeometry#

class t3toolbox.manifold.CorewiseGeometry#

The Euclidean geometry of the core parameter space P (the over-parametrized cover of M).

Optimization happens on the raw cores: tangents are perturbations of the cores (U, G, G, G) (the non-orthonormal frame whose down/left/right cores are all the TT cores G), the metric is the plain Euclidean (corewise) inner product, the “projection” is the identity (no gauge), and the retraction is vector addition in the cores. The corewise gradient is a genuine T3Tangent at this frame – not a raw tuple. Gauge directions lie in the kernel of the pushforward, so the Gauss-Newton Hessian is gauge-singular (fine for Adam / L-BFGS, needs regularization for Newton). Use the module singleton COREWISE. The §6.3 substitution (O, P, Q) -> G is exactly this change of frame; the manifold counterpart is ManifoldGeometry.

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.manifold as t3m
>>> np.random.seed(0)
>>> x = t3.TuckerTensorTrain.randn((10, 11, 12), (3, 4, 3), (1, 2, 2, 1))
>>> frame = t3m.COREWISE.frame(x)            # the (U, G, G, G) frame
>>> v = t3m.COREWISE.randn(frame)           # raw randn cores (no gauge)
>>> print(v.is_gauged())
False
>>> y = t3m.COREWISE.retract(v)            # additive: cores += v (a multilinear curve on M)
>>> U, G = x.data
>>> dU, dG = v.variations.tucker_variations, v.variations.tt_variations
>>> ref = t3.TuckerTensorTrain(tuple(u + du for u, du in zip(U, dU)),
...                            tuple(g + dg for g, dg in zip(G, dG)))
>>> print(bool(np.allclose(y.to_dense(), ref.to_dense())))
True

Methods#

frame(x)

The core-parameter frame at x: (U, G, G, G) (down/left/right all the TT cores G).

randn(frame[, stack_shape])

Random tangent at frame: raw i.i.d. N(0, 1) variation cores (the natural corewise Gaussian).

randn_like(tangent)

A raw random tangent at tangent's frame, with tangent's tangent stack K.

project(v)

The identity: the core parameter space is Euclidean, with no gauge projection.

inner(t1, t2)

The Euclidean (coordinate) inner product of two tangents on the core parameter space.

norm(t)

The Euclidean (coordinate) norm of a tangent (= T3Tangent.corewise_norm()); no

retract(p)

Additive retraction: add the variation cores to the point's cores (cores += p).