ufv_zero_point_frame#

t3toolbox.backend.ufv_operations.ufv_zero_point_frame(frame_data, groups=(), seed=fv_operations.ZERO_FRAME_SEED)#
def ufv_zero_point_frame(
        frame_data:  typ.Tuple,                                   # uniform frame .data = (down, up, left, right, shape, masks); stack C = ()
        groups:      typ.Tuple[typ.Tuple[int, ...], ...] = (),    # sharing partition (canonical_groups); () = unshared
        seed:        int = fv_operations.ZERO_FRAME_SEED,         # the Haar stream seed: a fixed convention
) -> typ.Tuple:                                                   # uniform frame .data at the zero tensor; the template's masks

The uniform twin of fv_zero_point_frame(): the canonical orthonormal frame at the zero tensor, with frame_data’s structure.

It unpacks the template’s real blocks (ut3frame_to_t3frame()), builds the ragged canonical frame from their shapes, and packs it back at the template’s own padded sizes (t3frame_to_ut3frame()). So its real blocks are the ragged construction’s exactly, and the zero-tensor reference built on it is the same number on both layers. The output masks are the template’s; the padding is zero.

Host-side and eager by design: it reads the masks (host numpy) to unpack, so it is never traced. The optimizers call it once per newton_cg / gradient_descent run, outside any jit. A stacked template raises NotImplementedError, as the ragged function does.

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.uniform_tucker_tensor_train as ut3
>>> import t3toolbox.backend.fv_conversions as fvc
>>> import t3toolbox.backend.fv_operations as fvo
>>> import t3toolbox.backend.ufv_conversions as ufc
>>> import t3toolbox.backend.ufv_operations as ufo
>>> x = t3.TuckerTensorTrain.zeros((5, 6, 7), (2, 3, 2), (1, 2, 2, 1))
>>> uframe = ufc.ut3_orthogonal_representations(ut3.UniformTuckerTensorTrain.from_t3(x).data)[0]
>>> zframe = ufo.ufv_zero_point_frame(uframe)
>>> ragged = fvo.fv_zero_point_frame(fvc.t3_orthogonal_representations(x.data)[0])
>>> all(np.allclose(a, b) for fa, fb in zip(ufc.ut3frame_to_t3frame(zframe), ragged)
...     for a, b in zip(fa, fb))                     # the same real blocks as the ragged construction
True
>>> zframe[5] is uframe[5]                           # the template's masks
True
Parameters:
  • frame_data (t3toolbox.backend.common.typ.Tuple)

  • groups (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, ...], ...])

  • seed (int)

Return type:

t3toolbox.backend.common.typ.Tuple