UT3Frame#
- class t3toolbox.uniform_frame_variations_format.UT3Frame#
Frame (orthogonal frame) for the frame-variations representation of uniform Tucker tensor trains.
Uniform analog of
T3Frame: four padded supercores (up_tucker,down_tt,left_tt,right_tt) + the static physicalshape(an int tuple, shared across the stack) + aUT3FrameMasksholder (the four per-stack rank masks).Examples
>>> import numpy as np >>> import t3toolbox.uniform_frame_variations_format as ubcf >>> d, N, nU, nD, rL, rR = 3, 6, 4, 5, 3, 2 >>> up = np.random.randn(d, nU, N) >>> down = np.random.randn(d, rL, nD, rR) >>> left = np.random.randn(d, rL, nU, rL) >>> right = np.random.randn(d, rR, nU, rR) >>> shape = (4, 5, 6) # real mode dims (each <= N=6) >>> up_mask = np.arange(nU) < np.array([[2],[3],[4]]) # (d, nU); per-mode up rank >>> down_mask = np.arange(nD) < np.array([[3],[4],[5]]) # (d, nD) >>> left_mask = np.arange(rL) < np.array([[1],[2],[3],[1]]) # (d+1, rL); boundary TT ranks >>> right_mask = np.arange(rR) < np.array([[1],[2],[2],[1]]) # (d+1, rR) >>> masks = ubcf.UT3FrameMasks(up_mask, down_mask, left_mask, right_mask) >>> B = ubcf.UT3Frame(up, down, left, right, shape, masks) >>> B.shape (4, 5, 6) >>> np.asarray(B.up_ranks).tolist() [2, 3, 4] >>> B.stack_shape ()
- shape: t3toolbox.backend.common.typ.Tuple[int, Ellipsis]#
- masks: UT3FrameMasks#
Methods#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Apply masks to the frame supercores, zeroing out unmasked entries. |
|
Max deviation of the (masked) frame supercores from orthonormality, per stack element |
|
|
True (per stack element) if the frame supercores are orthogonal in their respective senses on |
Structural minimal ranks |
|
True (per stack element) if the frame has structurally minimal ranks: |
|
|
True (per stack element) if the frame is numerically minimal. |
|
|
|
|
|
Pack a ragged |
Convert to a ragged |
|
|
Orthogonal frame at the point |
|
The base point this frame represents, as a |
|
Dense tensor of the base point this frame represents ( |
|
Reverse the mode order. Left/right supercores (and masks) swap roles -- reversing a |
Orthogonal representation of the base point this frame reconstructs to ( |
|
|
Orthogonal representation of a random uniform T3 -- a genuine random base point (orthogonal, |
|
A random orthogonal frame with the same shape / ranks / stack as |
|
Save the four supercores + |
|
Load a frame saved by |
The four padded supercores |
|
True if any supercore is a jax array (the masks are always host numpy). |
|
|
|
|
|
|
|
|
|
|
Check rank and shape consistency of a uniform Tucker tensor train frame (UT3Frame). |
|
Unstack a stacked UT3Frame into an array-like tree (shaped like |
|
Stack an array-like tree of UT3Frame into a single stacked UT3Frame. |