tensorly.decomposition.TensorTrain

class TensorTrain(rank, svd='truncated_svd', verbose=False)[source]

Decompose a tensor into a matrix in tt-format

Parameters:
tensortensorized matrix

if your input matrix is of size (4, 9) and your tensorized_shape (2, 2, 3, 3) then tensor should be tl.reshape(matrix, (2, 2, 3, 3))

rank‘same’, float or int tuple
  • if ‘same’ creates a decomposition with the same number of parameters as tensor

  • if float, creates a decomposition with rank x the number of parameters of tensor

  • otherwise, the actual rank to be used, e.g. (1, rank_2, …, 1) of size tensor.ndim//2. Note that boundary conditions dictate that the first rank = last rank = 1.

svdstr, default is ‘truncated_svd’

function to use to compute the SVD, acceptable values in tensorly.SVD_FUNS

verboseboolean, optional

level of verbosity

Returns:
tt_matrix