TuckerTensorTrain#
- class t3toolbox.tucker_tensor_train.TuckerTensorTrain#
Tucker tensor train with non-uniform (ragged) shape and ranks.
Tensor network diagram for a TuckerTensorTrain with
dfree indices:r0 r1 r2 r(d-1) rd 1 ------ G0 ------ G1 ------ ... ------ G(d-1) ------ 1 | | | | n0 | n1 | nd | | | B0 B1 B(d-1) | | | | N0 | N1 | Nd | | |
Cores:#
The TuckerTensorTrain is defined by its cores:
tucker_cores: Tuple[NDArray,…]tucker_cores = (B0, ..., B(d-1)),Bi.shape=stack_shape+(ni, Ni)
tt_cores: Tuple[NDArray,…]tt_cores = (G0, ..., G(d-1)),Gi.shape=stack_shape+(ri, ni, r(i+1))
Example:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with zeros >>> print(x.core_shapes) (((4, 14), (5, 15), (6, 16)), ((1, 4, 3), (3, 5, 2), (2, 6, 1))) >>> print(x.data == (tucker_cores, tt_cores)) True
Shape and ranks:#
The structure of a Tucker tensor train is defined by its shape and ranks:
shape: Tuple[int,…]shape = (N0, N1, ..., N(d-1))
tucker_ranks: Tuple[int,…]tucker_ranks = (n0, r1, ..., n(d-1))
tt_ranks: Tuple[int,…]tt_ranks = (r0, r1, ..., rd)
stack_shape: Tuple[int,…](optional, more on this below)
Often, the first and last TT-ranks satisfy
r0=rd=1, and “1” in the diagram is the number 1. However, it is allowed for these ranks to not be 1, in which case the “1”s in the diagram are vectors of ones. You can maker0=rd=1usingsquash_tails().Example:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with zeros >>> print(x.d) 3 >>> print(x.shape) (14, 15, 16) >>> print(x.tucker_ranks) (4, 5, 6) >>> print(x.tt_ranks) (1, 3, 2, 1)
Stacking:#
Many stacked Tucker tensor trains with the same shape and ranks may be stored in this object for vectorized operations. In this case,
tucker_cores[ii].shape=stack_shape+(ni,Ni)tt_cores[ii].shape=stack_shape+(ri, ni, r(i+1))
If no stacking is used, then
stack_shape=().Operations that use a numerical tolerance (
rtoloratol) cannot be used with stacked TuckerTensorTrains because the shape of the results could vary between different elements of the stack.Examples:
Create a stacked TuckerTensorTrain from stacked core arrays:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = [np.ones((6,7, 4,14)),np.ones((6,7, 5,15)),np.ones((6,7, 6,16))] >>> tt_cores = [np.ones((6,7, 1,4,3)), np.ones((6,7, 3,5,2)), np.ones((6,7, 2,6,1))] >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with ones >>> print(x.stack_shape) (6, 7) >>> print(x.structure) ((14, 15, 16), (4, 5, 6), (1, 3, 2, 1), (6, 7))
Create a stacked TuckerTensorTrain by stacking several TuckerTensorTrains:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x00 = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3)) >>> x01 = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3)) >>> x10 = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3)) >>> x11 = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3)) >>> print([B.shape for B in x00.tucker_cores]) [(4, 13), (5, 14), (6, 15)] >>> print([G.shape for G in x00.tt_cores]) [(2, 4, 8), (8, 5, 9), (9, 6, 3)] >>> print(x00.stack_shape) () >>> x_stacked = t3.TuckerTensorTrain.stack([[x00, x01], [x10, x11]]) >>> print([B.shape for B in x_stacked.tucker_cores]) [(2, 2, 4, 13), (2, 2, 5, 14), (2, 2, 6, 15)] >>> print([G.shape for G in x_stacked.tt_cores]) [(2, 2, 2, 4, 8), (2, 2, 8, 5, 9), (2, 2, 9, 6, 3)] >>> print(x_stacked.stack_shape) (2, 2)
Using
rtoloption int3svd()yields an error for stacked TuckerTensorTrains>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3)) >>> result = x.t3svd() # OK >>> result = x.t3svd(rtol=1e-2) # OK >>> x = t3.TuckerTensorTrain.randn((13,14,15), (4,5,6), (2,8,9,3), stack_shape=(2,3)) >>> result = x.t3svd() # OK >>> result = x.t3svd(rtol=1e-2) # Error! Traceback (most recent call last): ... ValueError
Minimal ranks:#
- Tucker tensor train ranks are minimal if they satisfy the following conditions,
r(i+1) <= (ri*ni)fori=1,...,dri <= (ni*r(i+1))fori=1,...,dni <= (ri*r(i+1))fori=1,...,dni <= Nifori=1,...,d
The first three conditions say that the product of any two dimensions of a TT core is at least as large as the other dimension. The last condition says that the Tucker ranks are less than the tensor shape.
Here, minimal ranks are defined with respect to a generic Tucker tensor train with the given shape and rank structure. We do not account for numerical rank deficiency.
- Minimal ranks always exist and are unique.
Minimal TT ranks are equal to the ranks of
(N0*...*Ni) x (N(i+1)*...*N(d-1))matrix unfoldings.Minimal Tucker ranks are equal to the ranks of
Ni x (N0*...*N(i-1)*N(i+1)*...*N(d-1))matricizations.
More details on the connection between minimal ranks and unfoldings/matricizations are given in Section 2.3 of [1].
Example:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,99,6,7), (1,4,9,7,1)) # random T3 >>> print(x.ranks) ((4, 99, 6, 7), (1, 4, 9, 7, 1)) >>> print(x.minimal_ranks) ((4, 14, 6, 7), (1, 4, 9, 7, 1)) >>> print(x.has_minimal_ranks) False >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,4,9,7,1)) >>> print(x.has_minimal_ranks) True >>> x = t3.TuckerTensorTrain.zeros((13,14,15,16), (4,5,6,7), (1,4,9,7,1)) # T3 filled with zeros >>> print(x.has_minimal_ranks) # minimal ranks depends on structural ranks, not numerical ranks True
Making a TuckerTensorTrain have minimal ranks using
t3svd():>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,99,9,7,1)) >>> print(x.has_minimal_ranks) False >>> print(x.minimal_ranks) # the inflated TT bond 99 is structurally minimal at 4 ((4, 5, 6, 7), (1, 4, 9, 7, 1)) >>> x2, _, _ = x.t3svd() >>> print(x2.has_minimal_ranks) True
Tensor linear algebra:#
Linear algebra operations (
addition,subtraction,multiplication,negation,inner products,norms,summing over axes) are mathematically defined with respect to theN0 x ... x N(d-1)dense tensors represented by the Tucker tensor trains. These operations are performed implicitly using Tucker tensor train cores as a computational device, because the dense tensors can be extremely large. The results faithfully represent what one would have gotten if one performed the operations on the dense tensors. E.g.: .. math:: (x + y).to_dense() = x.to_dense() + y.to_dense()Adding Tucker tensor trains adds their ranks, and multiplication multiplies their ranks. To prevent ranks growing too large when many linear algebra operations are performed in sequence, it may be useful to perform truncated T3SVDs between operations (using either
max_tucker_ranks,rtol, oratolas parameters int3svd()).For corewise operations, see
t3toolbox.corewiseExamples:
Add two TuckerTensorTrains
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (2,8,9,7,3)) >>> y = t3.TuckerTensorTrain.randn((13,14,15,16), (9,8,7,6), (1,2,3,4,5)) >>> print(np.allclose((x + y).to_dense(), x.to_dense() + y.to_dense())) True
A more complicated linear algebra operation with three TuckerTensorTrains
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (2,3,4,3), (1,2,4,3,2)) >>> y = t3.TuckerTensorTrain.randn((13,14,15,16), (4,3,5,1), (4,3,2,1,2)) >>> z = t3.TuckerTensorTrain.randn((13,14,15,16), (1,2,3,4), (1,2,3,4,5)) >>> result = (x * (y * 2.4 + z)).inner(z) + (x - y).norm() + z.sum() >>> X, Y, Z = x.to_dense(), y.to_dense(), z.to_dense() >>> result2 = np.einsum('ijkl,ijkl', (X * (Y * 2.4 + Z)), Z) + np.linalg.norm(X - Y) + Z.sum() >>> print(np.allclose(result, result2)) True
References
- tucker_cores: Tuple[NDArray, Ellipsis]#
Tucker cores for the TuckerTensorTrain.
tucker_cores=(B0, ..., B(d-1)).len(tucker_cores)=d,tucker_cores[ii]=stack_shape+(ni, Ni).
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.tucker_cores == tucker_cores) True
- tt_cores: Tuple[NDArray, Ellipsis]#
TT cores for the TuckerTensorTrain.
tt_cores=(G0, ..., G(d-1)).len(tt_cores)=d,tt_cores[ii]=stack_shape+(ri, ni, r(i+1)).
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.tt_cores == tt_cores) True
- property data: Tuple[Tuple[NDArray, Ellipsis], Tuple[NDArray, Ellipsis]]#
Tuple containing the Tucker cores and TT cores.
data=(tucker_cores, tt_cores)Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.ones((4,14)),np.ones((5,15)),np.ones((6,16))) >>> tt_cores = (np.ones((1,4,3)), np.ones((3,5,2)), np.ones((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.data == (tucker_cores, tt_cores)) True
- property d: int#
Number of indices of the tensor.
d=len(tucker_cores)=len(tt_cores)Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.d) 3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.d) 2
- Return type:
int
- property stack_shape: Tuple[int, Ellipsis]#
If this object contains multiple stacked T3s with the same structure, this is the shape of the stack. If no stacking is used then
stack_shape=().tucker_cores[ii].shape = stack_shape+(ni, Ni)tt_cores[ii].shape = stack_shape+(ri, ni, r(i+1))
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = [np.zeros((4,14)),np.zeros((5,15)), np.zeros((6,16))] >>> tt_cores = [np.zeros((1,4,3)), np.zeros((3,5,2)), np.ones((2,6,1))] >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.stack_shape) () >>> tucker_cores = [np.zeros((6, 4,14)),np.zeros((6, 5,15)), np.zeros((6, 6,16))] >>> tt_cores = [np.zeros((6, 1,4,3)), np.zeros((6, 3,5,2)), np.ones((6, 2,6,1))] >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.stack_shape) (6,) >>> tucker_cores = [np.zeros((6,7, 4,14)),np.zeros((6,7, 5,15)), np.zeros((6,7, 6,16))] >>> tt_cores = [np.zeros((6,7, 1,4,3)), np.zeros((6,7, 3,5,2)), np.ones((6,7, 2,6,1))] >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.stack_shape) (6, 7)
- Return type:
Tuple[int, Ellipsis]
- property shape: Tuple[int, Ellipsis]#
Shape of the represented dense tensor.
shape=(N0,...,N(d-1))Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.shape) (14, 15, 16)
- Return type:
Tuple[int, Ellipsis]
- property tucker_ranks: Tuple[int, Ellipsis]#
Tucker ranks.
tucker_ranks=(n0,...,n(d-1))Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.tucker_ranks) (4, 5, 6)
- Return type:
Tuple[int, Ellipsis]
- property tt_ranks: Tuple[int, Ellipsis]#
TT ranks.
tt_ranks=(r0,...,rd)>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.tt_ranks) (1, 3, 2, 1)
- Return type:
Tuple[int, Ellipsis]
- property ranks: Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis]]#
Tuple containing Tucker ranks and TT ranks.
ranks = (tucker_ranks, tt_ranks)tucker_ranks = (n0,...,n(d-1))tt_ranks = (r0,...,rd)
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.ranks) ((4, 5, 6), (1, 3, 2, 1))
- Return type:
Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis]]
- property structure: Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis], Tuple[int, Ellipsis], Tuple[int, Ellipsis]]#
Tuple containing tensor shape, Tucker ranks, TT ranks, and stack shape.
structure = (shape, tucker_ranks, tt_ranks, stack_shape)shape = (N0,...,N(d-1))tucker_ranks = (n0,...,n(d-1))tt_ranks = (r0,...,rd)stack_shape(optional, default:stack_shape=())
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) >>> print(x.structure) ((14, 15, 16), (4, 5, 6), (1, 3, 2, 1), ())
- Return type:
Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis], Tuple[int, Ellipsis], Tuple[int, Ellipsis]]
- property core_shapes: Tuple[Tuple[Tuple[int, Ellipsis], Ellipsis], Tuple[Tuple[int, Ellipsis], Ellipsis]]#
Shapes of the Tucker and TT cores.
cores_shapes = (tucker_core_shapes, tt_core_shapes).len(tucker_core_shapes) = len(tt_core_shapes) = dtucker_core_shapes[ii] = (ni, Ni)tt_core_shapes[ii] = (ri, ni, r(i+1))
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with zeros >>> print(x.core_shapes) (((4, 14), (5, 15), (6, 16)), ((1, 4, 3), (3, 5, 2), (2, 6, 1)))
- Return type:
Tuple[Tuple[Tuple[int, Ellipsis], Ellipsis], Tuple[Tuple[int, Ellipsis], Ellipsis]]
- property size: int#
Size of the dense tensor represented by this TuckerTensorTrain.
size=N0*...*N(d-1).Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with zeros >>> print(x.size == 14*15*16) True
- Return type:
int
- property data_size: int#
Sum of the sizes of all Tucker and TT cores.
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> tucker_cores = (np.zeros((4,14)), np.zeros((5,15)), np.zeros((6,16))) >>> tt_cores = (np.zeros((1,4,3)), np.zeros((3,5,2)), np.zeros((2,6,1))) >>> x = t3.TuckerTensorTrain(tucker_cores, tt_cores) # TuckerTensorTrain, cores filled with zeros >>> print(x.data_size == 4*14 + 5*15 + 6*16 + 1*4*3 + 3*5*2 + 2*6*1) True
- Return type:
int
- property minimal_ranks: Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis]]#
Ranks of the smallest possible TuckerTensorTrain that could represent the same dense tensor as this TuckerTensorTrain. TuckerTensorTrains ranks may be made minimal using T3-SVD.
minimal_ranks = (minimal_tucker_ranks, minimal_tt_ranks)len(minimal_tucker_ranks) = dlen(minimal_tt_ranks) = d+1
Examples
A Tucker rank is not minimal:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,99,6,7), (1,4,9,7,1)) >>> print(x.ranks) ((4, 99, 6, 7), (1, 4, 9, 7, 1)) >>> print(x.minimal_ranks) ((4, 14, 6, 7), (1, 4, 9, 7, 1))
A TT-rank is not minimal:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,4,99,7,1)) >>> print(x.ranks) ((4, 5, 6, 7), (1, 4, 99, 7, 1)) >>> print(x.minimal_ranks) ((4, 5, 6, 7), (1, 4, 20, 7, 1))
- Return type:
Tuple[Tuple[int, Ellipsis], Tuple[int, Ellipsis]]
- property has_minimal_ranks: bool#
True if this Tucker tensor train’s ranks are minimal, False otherwise.
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,99,6,7), (1,4,9,7,1)) >>> print(x.has_minimal_ranks) # Tucker rank too big False >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,99,9,7,1)) >>> print(x.has_minimal_ranks) # TT rank too big False >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,4,9,7,1)) >>> print(x.has_minimal_ranks) True
Make ranks minimal with t3svd:
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> x = t3.TuckerTensorTrain.randn((13,14,15,16), (4,5,6,7), (1,99,9,7,1)) >>> print(x.has_minimal_ranks) False >>> print(x.minimal_ranks) ((4, 5, 6, 7), (1, 4, 9, 7, 1)) >>> x2 = x.t3svd()[0] >>> print(x2.has_minimal_ranks) True
- Return type:
bool
Methods#
|
|
|
Compute the Tucker and TT core shapes for a Tucker tensor train. |
|
Find minimal ranks for a hypothetical TuckerTensorTrain with given shape and ranks. |
|
True if the ranks are numerically minimal: no stored rank is numerically redundant. |
|
True (per stack element) if this T3 is in left-orthogonal form: every Tucker core |
|
True (per stack element) if this T3 is in right-orthogonal form: every Tucker core |
|
Check internal consistency of the Tucker tensor train. |
|
Form dense tensor from this TuckerTensorTrain. |
|
Extract contiguous segment of this TuckerTensorTrain. Segments must have length at least one. |
|
Concatenates TuckerTensorTrain segments. |
Make leading and trailing TT ranks equal to 1 ( |
|
|
Reverse Tucker tensor train. |
|
Change shape and ranks by resizing cores. Makes cores bigger via zero padding. Makes cores smaller via truncation. |
|
Convert core arrays defining TuckerTensorTrain to Jax arrays. |
|
Convert arrays defining TuckerTensorTrain into Numpy arrays. |
|
Copy TuckerTensorTrain. |
|
If this object contains multiple stacked T3s, this unstacks them |
|
Stacks an array-like tree of TuckerTensorTrains into one stacked TuckerTensorTrain. |
|
Construct a Tucker tensor train of zeros. |
|
Construct TuckerTensorTrain representation of dense tensor filled with ones. |
|
Construct a Tucker tensor train with random cores. Core entries are i.i.d. draws from N(0,1). |
|
Constructs TuckerTensorTrain from Canonical decomposition. |
|
Convert tensor train into Tucker tensor train by using identity matrices for Tucker bases. |
Convert this TuckerTensorTrain to a tensor train by contracting Tucker bases with TT cores. |
|
Converts a TuckerTensorTrain into a 1D vector containing the core entries. |
|
|
Constructs a TuckerTensorTrain from a 1D vector containing the core entries. |
|
Save a Tucker tensor train to a file. |
|
Load a Tucker tensor train from a file. |
|
Add this TuckerTensorTrains self to other tensor, yielding a tensor |
|
Elementwise multiplication of a Tucker tensor train by another tensor, |
|
Elementwise (Hadamard) product |
|
Scale a TuckerTensorTrain by -1. |
|
Subtract Tucker tensor trains, |
|
Compute Hilbert-Schmidt inner product of this TuckerTensorTrain with other tensor, |
|
Compute Hilbert-Schmidt (Frobenius) norm of this TuckerTensorTrain. |
|
Sum over one or more axes of TuckerTensorTrain. |
|
Sum the tensors represented by a stacked TuckerTensorTrain over one or more stack axes. |
|
Sum the core arrays of a stacked TuckerTensorTrain over one or more stack axes. |
|
Compute SVD of ith tucker core and contract non-orthogonal factor into the TT-core above. |
|
Compute SVD of ith TT-core left unfolding and contract non-orthogonal factor into the TT-core to the right. |
|
Compute SVD of ith TT-core right unfolding and contract non-orthogonal factor into the TT-core to the left. |
|
Compute SVD of ith TT-core right unfolding and contract non-orthogonal factor down into the tucker core below. |
Orthogonalize cores in the TuckerTensorTrain relative to the ith Tucker core. |
|
Orthogonalize cores in the TuckerTensorTrain relative to the ith TT-core. |
|
Orthogonalize Tucker cores downwards, pushing remainders onto TT cores above. |
|
Up orthogonalize TT cores, pushing remainders onto Tucker cores below. |
|
|
Left orthogonalize the TT cores, possibly returning variation cores as well. |
|
Right orthogonalize the TT cores, possibly returning variation cores as well. |
|
Compute an entry (or multiple entries) of a Tucker tensor train. |
|
Contract a Tucker tensor train with vectors in all indices. |
|
Probe a TuckerTensorTrain. |
|
Ambient transpose of |
|
Corewise (non-manifold) transpose of |
|
Ambient transpose of |
|
Ambient transpose of |
|
Corewise (non-manifold) transpose of |
|
Corewise (non-manifold) transpose of |
|
Symmetric directional derivatives of probing this Tucker tensor train, in one repeated direction. |
|
Symmetric directional derivatives of applying this T3 in all modes, in one repeated direction. |
|
Symmetric directional derivatives of this T3's entries at |
|
Corewise (non-manifold) transpose of |
|
Corewise transpose of |
|
Corewise transpose of |
|
Compute (truncated) T3-SVD of Tucker tensor train. |
|
Rank-continuation update (Section 5.4.1): the ranks to grow to next, from this iterate's spectra. |
|
A single lossless directional sweep that drops structurally-redundant ranks (the separate |
|
Compute |