T3FrameWeights#

class t3toolbox.frame_variations_format.T3FrameWeights#

Diagonal weights defining a metric on the tangent coordinates – a Grasedyck-Kramer-style reweighting of the d variation directions (penalise poorly-informed ones with e.g. 1/sigma).

Four families, each len=d (one per variation core, Approach-1 / metric-on-variations): up (on H’s nU leg), down (on V’s nD leg), left (H’s rL), right (H’s rR). T3Tangent.weighted_norm() / weighted_inner() absorb these into the variation cores and take the coordinate norm/inner – the frame stays orthonormal and untouched.

Batching: a weight is FRAME-like (it is absorbed into the variations, but it batches with the frame – do not conflate the two). Every vector is stack_shape + (rank,), and that stack is the frame stack C, like T3Framenot the variations’ K + C: a weight is one metric per base point, shared by all K tangent vectors at that frame, and it broadcasts over K for free (C is innermost). Pairing with variations alone follows the same trailing-stack rule as check_fv_pair() (the weight’s stack is the trailing/inner part of the variation stack); at the tangent level, where the frame is present too, check_fw_pair() enforces the exact weights.stack_shape == frame.stack_shape.

up_weights: t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]#
down_weights: t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]#
left_weights: t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]#
right_weights: t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]#

Methods#

data()

d()

up_ranks()

down_ranks()

left_ranks()

right_ranks()

stack_shape()

validate()

Structural: four families each of length d, and one uniform stack_shape on every vector.

__post_init__()

is_consistent_with(tangent)

True iff these weights match the variation ranks + stack of a T3Tangent (or T3Variations).

reciprocal()

Elementwise 1/w on every family (e.g. inverse-singular-value weights).

sqrt()

Elementwise sqrt on every family.

reverse()

Reverse the mode order, swapping left``<->``right (mirrors T3Frame.reverse()).

concatenate(other)

Per-edge concatenation (the + combine; ranks add).

kronecker(other)

Per-edge Kronecker product (the Hadamard combine; ranks multiply).

unstack()

Unstack a stack of frame-weights into an array-like tree (mirrors T3Variations.unstack).

stack(xx)

Stack an array-like tree of frame-weights into one (mirrors T3Variations.stack).

from_t3weights(t3_weights)

Build a tangent metric from base-point edge weights (e.g. T3Weights.from_t3svd(x)):