t3toolbox.OLD_uniform#
Attributes#
Tuple containing supercores of a Uniform Tucker tensor train |
|
Tuple containing edge masks for a Uniform Tucker tensor train. Often used for masking. |
|
Base supercores for base-variation representation of Uniform Tucker tensor train. |
|
Variation supercores for base-variation representation of Uniform Tucker tensor train. |
|
Edge weights for base-variation format. |
|
Shape and rank structure of a uniform base-variation T3 representation. |
Functions#
|
Get the structore of a uniform base. |
|
Get the hole shapes for a uniform base. |
|
Check internal shape consistency of UniformTuckerTensorTrain. |
|
Get padded structure of uniform Tucker tensor train. |
|
Get original (unpadded) structure of a uniform Tucker tensor train. |
|
Apply masks to uniform Tucker tensor train cores. |
|
Apply masks to uniform Tucker tensor train base. |
|
Apply masks to uniform Tucker tensor train variation. |
|
Squash tails of uniform Tucker tensor train. |
|
Use zero-padding to pack several tensors with ragged shapes into one tensor with an extra dimension. |
|
Get ragged (variable length) edge vectors from uniform edge vectors. |
|
|
|
Makes a uniform Tucker tensor train with random cores. |
|
Makes a uniform Tucker tensor train with cores filled with zeros. |
|
Convert TuckerTensorTrain to UniformTuckerTensorTrain. |
|
Convert UniformTuckerTensorTrain to TuckerTensorTrain. |
|
|
|
Construct dense tensor represented by uniform Tucker tensor train |
|
Checks if the ranks of a uniform Tucker train are minimal. |
|
Compute entry (entries) of a uniform Tucker tensor train. |
|
Add two UniformTuckerTensorTrains, x,y -> x+y. |
|
Scale a uniform Tucker tensor train, s,x -> s*x. |
|
Flip a uniform Tucker tensor train, x -> -x. |
|
Subtract two UniformTuckerTensorTrains, x,y -> x-y. |
Module Contents#
- t3toolbox.OLD_uniform.UniformTuckerTensorTrain#
Tuple containing supercores of a Uniform Tucker tensor train
Uniform Tucker tensor trains are created by padding a Tucker tensor train so that the ranks are uniform, then stacking the TT cores and Tucker cores into “supercores”, which have one more dimension.
Padding may be tracked with boolean mask arrays associated with the edges.
See also
UniformTuckerTensorTrainMasks
- Components
tucker_supercore: NDArray. shape=(d, n, N). Stacked padded tucker cores
tt_supercore: NDArray. shape=(d, r, n, r). Stacked padded TT-cores
- Here:
d = num_cores
N = padded_shape
n = padded_tucker_rank
r = padded_tt_rank
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> x = t3.t3_corewise_randn(((14,15,16), (4,6,5), (1,3,2,1))) >>> cores, masks = ut3.t3_to_ut3(x) >>> print(ut3.get_padded_structure(cores)) (3, 16, 6, 3) >>> print(ut3.original_structure(masks)) ((14, 15, 16), (4, 6, 5), (1, 3, 2, 1))
- t3toolbox.OLD_uniform.UniformEdgeWeights#
Tuple containing edge masks for a Uniform Tucker tensor train. Often used for masking.
See also
UniformTuckerTensorTrainCores
- Components
shape_masks: NDArray. shape=(d,N). Weights for edges between Tucker cores and exterior of tensor
tucker_masks: NDArray. shape=(d,n). Weights for edges between Tucker cores and adjacent TT-cores
tt_masks: NDArray. shape=(d+1,r). Weights for edges between adjacent TT-cores
- Here:
d = num_cores
N = padded_shape
n = padded_tucker_rank
r = padded_tt_rank
Examples
>>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.uniform_tucker_tensor_train as ut3 >>> x = t3.t3_corewise_randn(((14,15,16), (4,6,5), (1,3,2,1))) >>> cores, masks = ut3.t3_to_ut3(x) >>> print(ut3.get_padded_structure(cores)) (3, 16, 6, 3) >>> print(ut3.original_structure(masks)) ((14, 15, 16), (4, 6, 5), (1, 3, 2, 1))
- t3toolbox.OLD_uniform.UniformT3Base#
Base supercores for base-variation representation of Uniform Tucker tensor train.
- The components of T3Base are the “base cores”:
up_tucker_cores: NDArray, shape=(d, nU, N), up orthogonal elements
left_tt_cores: NDArray, shape=(d, r, nU, r), left orthogonal elements
right_tt_cores: NDArray, shape=(d, r, nU, r), right orthogonal elements
outer_tt_cores: NDArray, shape=(d, r, nO, r), outer orthogonal elements
See also
t3toolbox.tucker_tensor_train.T3Base,UniformT3Variation
- t3toolbox.OLD_uniform.UniformT3Variation#
Variation supercores for base-variation representation of Uniform Tucker tensor train.
- Components
var_tucker_supercore: NDArray, shape=(d,nO,N)
var_tt_supercore: NDArray, shape=(d,r,nU,r)
The variation components should fit in the “holes” of a UniformT3Variation.
See also
t3toolbox.tucker_tensor_train.T3Variation,UniformT3Base
- t3toolbox.OLD_uniform.UniformBVEdgeWeights#
Edge weights for base-variation format.
- Components
shape_weights: NDArray, shape=(d,Ni)
up_tucker_weights: NDArray, shape=(d,nUi)
outer_tucker_weights: NDArray, shape=(d,nOi)
left_tt_weights: NDArray, shape=(d,rLi)
right_tt_weights: NDArray, shape=(d,rRi)
See also
t3tools.tucker_tensor_train.EdgeWeights,t3tools.basis_coordinates_format.BVEdgeWeights,UniformT3Variation,UniformT3Base
- t3toolbox.OLD_uniform.UniformBVStructure#
Shape and rank structure of a uniform base-variation T3 representation.
- Components
d: int, number of tensor indices
N: size of external indices
nU: up tucker rank
nO: outer tucker rank
rL: left TT rank
rR: right TT rank
See also