UT3FrameWeights#
- class t3toolbox.uniform_frame_variations_format.UT3FrameWeights#
Diagonal weights defining a metric on the tangent coordinates of a
UT3Frame– the uniform twin ofT3FrameWeights.Four families, each
len=d(one per variation core), packed into supercores + aUT3VariationsMasksholder:up(onH’snUleg),down(onV’snDleg),left(H’srL),right(H’srR). Absorbed into the variation supercores, leaving the frame orthonormal and untouched – so it isO(ranks).Batching: a weight is FRAME-like (it is absorbed into the variations, but it batches with the frame – do not conflate the two). Every supercore is
(d,) + C + (size,)whereCis the frame stack, not the variations’K + C: one metric per base point, shared by allKtangent vectors at that frame, broadcast overKfor free (Cis innermost). There is noshapefield: weights live only on internal edges.Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> import t3toolbox.uniform_frame_variations_format as ubvf >>> import t3toolbox.uniform_manifold as ut3m >>> np.random.seed(0) >>> x = t3.TuckerTensorTrain.randn((6, 7, 8), (2, 2, 2), (1, 2, 2, 1), stack_shape=(2,)) >>> ux = ut3.UniformTuckerTensorTrain.from_t3(x) >>> frame, _ = ubvf.ut3_orthogonal_representations(ux) >>> v = ut3m.UNIFORM_COREWISE.randn(frame, stack_shape=(3,)) # 3 tangents at each of 2 base points >>> print(frame.stack_shape, v.stack_shape) # C, then K + C (2,) (3, 2)
The metric is built from the base point’s singular values, so it carries
C– and pairs directly with theK-stack of tangents there:>>> W = ubvf.UT3FrameWeights.from_ut3weights(ut3.UT3Weights.from_ut3svd(ux)).reciprocal() >>> print(W.stack_shape) # C, NOT K + C (2,) >>> print(np.asarray(v.weighted_norm(W)).shape) # one norm per stacked tangent (3, 2)
- masks: UT3VariationsMasks#
Methods#
|
|
|
Raw-array view, mirroring the fields: |
|
|
|
|
|
|
|
|
|
|
The frame stack |
|
|
|
|
Structural: the four masks are boolean and match their supercores (same |
|
|
|
True iff this metric can be absorbed into a |
Elementwise |
|
|
Elementwise |
|
Per-edge concatenation (the |
|
Per-edge Kronecker product (the Hadamard combine; ranks multiply). Output masks are strided. |
|
Build a tangent metric from uniform base-point edge weights (e.g. |
|
Pack a ragged |
Convert back to ragged form. Unstacked: one |