tensorly.parafac2_tensor.parafac2_to_vec

parafac2_to_vec(parafac2_tensor)[source]

Construct a vectorized tensor from a PARAFAC2 decomposition. Uneven slices are padded by zeros.

The decomposition is on the form (A[Bi]C) such that the i-th frontal slice, Xi, of X is given by

Xi=Bidiag(ai)CT,

where diag(ai) is the diagonal matrix whose nonzero entries are equal to the i-th row of the I×R factor matrix A, Bi is a Ji×R factor matrix such that the cross product matrix Bi1TBi1 is constant for all i, and C is a K×R factor matrix. To compute this decomposition, we reformulate the expression for Bi such that

Bi=PiB,

where Pi is a Ji×R orthogonal matrix and B is a R×R matrix.

An alternative formulation of the PARAFAC2 decomposition is that the tensor element Xijk is given by

Xijk=r=1RAirBijrCkr,

with the same constraints hold for Bi as above.

Parameters:
parafac2_tensorParafac2Tensor - (weight, factors, projection_matrices)
  • weights1D array of shape (rank, )

    weights of the factors

  • factorsList of factors of the PARAFAC2 decomposition

    Contains the matrices A, B and C described above

  • projection_matricesList of projection matrices used to create evolving

    factors.

Returns:
ndarray

Full constructed tensor. Uneven slices are padded with zeros.