tensorly.tucker_tensor.tucker_to_vec

tucker_to_vec(core, factors, skip_factor=None, transpose_factors=False)[source]

Converts a Tucker decomposition into a vectorised tensor

Parameters:

core : ndarray

core tensor

factors : ndarray list

list of factor matrices

skip_factor : None or int, optional, default is None

if not None, index of a matrix to skip Note that in any case, modes, if provided, should have a lengh of tensor.ndim

transpose_factors : bool, optional, default is False

if True, the matrices or vectors in in the list are transposed

Returns:

1D-array

vectorised tensor

Notes

Mathematically equivalent but much slower, you can obtain the same result using:

>>> def tucker_to_vec(core, factors):
...     return kronecker(factors).dot(tensor_to_vec(core))