T3Frame.padded ============== .. py:method:: t3toolbox.frame_variations_format.T3Frame.padded(x_old, tucker_ranks, tt_ranks, sharing = None, seed = ZERO_FRAME_SEED) :staticmethod: .. code-block:: python 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_old`` at larger ranks: the start of an alignment. At a zero-padded rank increase the point ``x_old`` gains zero slots, and its orthonormal frame needs new directions there. This frame keeps ``x_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). :py:func:`fv_aligned_padded_frame` then aligns the new slots with a tangent hint; this is its start, and its ``max_passes=0`` result. ``x_old`` is first reduced to minimal ranks (the same tensor). A STRUCTURALLY ZERO ``x_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 contain ``x_old``'s structure. In safe mode, a shared ``x_old`` must have tied factors. Each store's new slot ``s`` is seeded by row ``s`` of 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 of ``x_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 :doc:`/aligned_padded_frame`. .. rubric:: 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