UT3Tangent.align_padded#

t3toolbox.uniform_manifold.UT3Tangent.align_padded(split, tucker_ranks=None, tt_ranks=None, sharing=None, update=('D', 'U', 'L', 'R'))#
def align_padded(
        self,
        split:         typ.Tuple[int, int],                                       # (Na, Rb), from UT3Frame.padded

        tucker_ranks:  typ.Optional[typ.Union[typ.Sequence[int], NDArray]] = None,   # len=d or HOST int (d,)+C, output; None = the frame's own
        tt_ranks:      typ.Optional[typ.Union[typ.Sequence[int], NDArray]] = None,   # len=d+1 or HOST int (d+1,)+C; None = the frame's own

        sharing:       typ.Optional[typ.Sequence] = None,                         # len=d group labels; None = unshared
        update:        typ.Collection[str] = ('D', 'U', 'L', 'R'),                # as T3Tangent.align_padded
) -> typ.Tuple[
    'ubv.UT3Frame',   # the aligned frame, block layout, new blocks real-first
    NDArray,          # movement, shape = frame stack C
]:

One alignment step of this tangent’s block-layout padded frame: the uniform twin of align_padded(). The old blocks are the leading split = (Na, Rb) slots (padded() returns it); the new blocks come out real-first at the output counts’ widths. It works on block-layout frames only, where the old blocks are the leading slots; a compacted frame (the loop twin’s output) has no split. See The aligned padded frame.

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 ubv
>>> import t3toolbox.uniform_manifold as ut3m
>>> np.random.seed(0)
>>> x_old = ut3.UniformTuckerTensorTrain.from_t3(t3.TuckerTensorTrain.randn((5, 6, 5), (2, 2, 2), (1, 2, 2, 1)))
>>> F, split = ubv.UT3Frame.padded(x_old, (3, 4, 3), (1, 3, 3, 1))
>>> hint = ut3.UniformTuckerTensorTrain.from_t3(t3.TuckerTensorTrain.randn((5, 6, 5), (5, 6, 5), (1, 5, 5, 1)))
>>> v = ut3m.UNIFORM_MANIFOLD.project_ambient(F, hint)
>>> F1, movement = v.align_padded(split)
>>> bool(F1.is_orthogonal()), float(movement) > 0
(True, True)
Parameters:
  • split (t3toolbox.backend.common.typ.Tuple[int, int])

  • tucker_ranks (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Union[t3toolbox.backend.common.typ.Sequence[int], NDArray]])

  • tt_ranks (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Union[t3toolbox.backend.common.typ.Sequence[int], NDArray]])

  • sharing (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Sequence])

  • update (t3toolbox.backend.common.typ.Collection[str])

Return type:

t3toolbox.backend.common.typ.Tuple[UT3Frame, NDArray]