T3Frame.padded#
- static t3toolbox.frame_variations_format.T3Frame.padded(x_old, tucker_ranks, tt_ranks, sharing=None, seed=ZERO_FRAME_SEED)#
def padded( x_old: 't3.TuckerTensorTrain', # the old point (reduced to minimal ranks here); rank 0 = the zero tensor tucker_ranks: typ.Sequence[int], # len=d, target tt_ranks: typ.Sequence[int], # len=d+1, target (boundary 1) sharing: typ.Optional[typ.Sequence] = None, # len=d group labels; None = unshared seed: int = ZERO_FRAME_SEED, # the keyed seed streams of the completions ) -> 'T3Frame': # the hint-free padded frame (old frame in the leading slots)
The hint-free padded frame of
x_oldat larger ranks: the start of an alignment.At a zero-padded rank increase the point
x_oldgains zero slots, and its orthonormal frame needs new directions there. This frame keepsx_old’s own frame in the leading slots of every store and fills the new slots by a data-independent convention: Gaussian seeds from keyed streams, one stream row per slot, completed against the old block (so successive starts never reuse a seed).fv_aligned_padded_frame()then aligns the new slots with a tangent hint; this is its start, and itsmax_passes=0result.x_oldis first reduced to minimal ranks (the same tensor). A STRUCTURALLY ZEROx_old– any Tucker rank or interior TT rank 0, e.g.TuckerTensorTrain.zeros(shape, (0,)*d, (1,)+(0,)*(d-1)+(1,))– is the zero tensor, whose frame is empty. The target ranks must containx_old’s structure. In safe mode, a sharedx_oldmust have tied factors.Each store’s new slot
sis seeded by rowsof a keyed Gaussian stream. So the start is isotropic (a random subspace of the old block’s complement), well conditioned, and successive starts never reuse a seed. It is a function ofx_old’s frame AS REPRESENTED, slot signs included: another basis of the same frame (at a singular-value tie, or a flipped slot sign) gives another, equally valid start. Do not compare hint-free starts across representations or BLAS builds; the aligned frames are comparable. See The aligned padded frame.Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.frame_variations_format as bvf >>> np.random.seed(0) >>> x_old = t3.TuckerTensorTrain.randn((5, 6, 5), (2, 2, 2), (1, 2, 2, 1)) >>> F = bvf.T3Frame.padded(x_old, (3, 4, 3), (1, 3, 3, 1)) >>> F.down_ranks, bool(F.is_orthogonal()) ((3, 4, 3), True)
The new frame represents the zero-padded point: its base point is still
x_old.>>> x0 = x_old.resize((5, 6, 5), (3, 4, 3), (1, 3, 3, 1)) >>> bool(t3.TuckerTensorTrain(F.down_tucker_cores, F.left_tt_cores).allclose(x0)) True
- Parameters:
x_old (TuckerTensorTrain)
tucker_ranks (t3toolbox.backend.common.typ.Sequence[int])
tt_ranks (t3toolbox.backend.common.typ.Sequence[int])
sharing (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Sequence])
seed (int)
- Return type: