T3Frame.variation_shapes#
- t3toolbox.frame_variations_format.T3Frame.variation_shapes()#
def variation_shapes( self, ) -> typ.Tuple[ typ.Tuple[typ.Tuple[int, ...], ...], # tucker_variation_shapes. len=d. elm_len=2 typ.Tuple[typ.Tuple[int, ...], ...], # tt_variation_shapes. len=d. elm_len=3 ]:
T3Variations shapes that fit with this T3Frame.
Shapes of the “holes” in the following tensor diagrams:
1 -- L0 -- ( ) -- R2 -- R3 -- 1 | | | | U0 U1 U2 U3 | | | | 1 -- L0 -- L1 -- O2 -- R3 -- 1 | | | | U0 U1 ( ) U3 | | | |
Examples
>>> import numpy as np >>> import t3toolbox.frame_variations_format as bvf >>> ss = (2, 3) # stack C -- NOT part of variation_shapes >>> up_tucker_cores = (np.ones(ss+(10, 14)), np.ones(ss+(11, 15)), np.ones(ss+(12, 16))) >>> down_tt_cores = (np.ones(ss+(1, 9, 4)), np.ones(ss+(2, 8, 5)), np.ones(ss+(3, 7, 1))) >>> left_tt_cores = (np.ones(ss+(1, 10, 2)), np.ones(ss+(2, 11, 3)), np.ones(ss+(3, 12, 5))) >>> right_tt_cores = (np.ones(ss+(2, 10, 4)), np.ones(ss+(4, 11, 5)), np.ones(ss+(5, 12, 1))) >>> frame = bvf.T3Frame(up_tucker_cores, down_tt_cores, left_tt_cores, right_tt_cores) >>> tucker_holes, tt_holes = frame.variation_shapes # (tucker hole shapes, tt hole shapes) >>> print(tucker_holes) # one (nDi, Ni) per mode ((9, 14), (8, 15), (7, 16)) >>> print(tt_holes) # one (rLi, nUi, rRi) per mode ((1, 10, 4), (2, 11, 5), (3, 12, 1))
- Return type:
t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, Ellipsis], Ellipsis], t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, Ellipsis], Ellipsis]]