tltorch
.TuckerMatrix¶

class
tltorch.
TuckerMatrix
(*args, **kwargs)[source]¶ Tensorized Matrix in Tucker Form
 Attributes
 decomposition
Methods
from_matrix
(matrix, tensorized_row_shape, …)Create a Tensorized Matrix by tensorizing and decomposing an existing matrix
new
(tensorized_row_shape, …[, n_matrices])Main way to create a Tensorized Matrix
normal_
([mean, std])Inialize the factors of the factorization such that the reconstruction follows a Gaussian distribution
Reconstruct the full tensor from its factorized form
from_tensor
init_from_matrix
init_from_tensor

classmethod
new
(tensorized_row_shape, tensorized_column_shape, rank, n_matrices=(), **kwargs)[source]¶ Main way to create a Tensorized Matrix
 Parameters
 tensorized_row_shapetuple[int]
The first dimension (rows) of the matrix will be tensorized to that shape
 tensorized_column_shapetuple[int]
The second dimension (columns) of the matrix will be tensorized to that shape
 rankint, ‘same’ or float
rank of the decomposition
 n_matricestuple or int, default is ()
if not (), indicates how many matrices have to be jointly factorized
 factorization{‘CP’, ‘TT’, ‘Tucker’}, optional
Tensor factorization to use to decompose the tensor, by default ‘CP’
 Returns
 TensorizedMatrix
Matrix in Tensorized and Factorized form.
 Raises
 ValueError
If the factorization given does not exist.

classmethod
from_matrix
(matrix, tensorized_row_shape, tensorized_column_shape, rank, **kwargs)[source]¶ Create a Tensorized Matrix by tensorizing and decomposing an existing matrix
 Parameters
 matrixtorch.tensor of order 2
matrix to decompose
 tensorized_row_shapetuple[int]
The first dimension (rows) of the matrix will be tensorized to that shape
 tensorized_column_shapetuple[int]
The second dimension (columns) of the matrix will be tensorized to that shape
 rankint, ‘same’ or float
rank of the decomposition
 n_matricestuple or int, default is ()
if not (), indicates how many matrices have to be jointly factorized
 factorization{‘CP’, ‘TT’, ‘Tucker’}, optional
Tensor factorization to use to decompose the tensor, by default ‘CP’
 Returns
 TensorizedMatrix
Matrix in Tensorized and Factorized form.
 Raises
 ValueError
If the factorization given does not exist.