tensorly.parafac2_tensor
.parafac2_to_slices

parafac2_to_slices
(parafac2_tensor, validate=True)[source] Generate all slices along the first mode from a PARAFAC2 tensor.
Generates a list of all slices from a PARAFAC2 tensor. A list is returned since the tensor might have varying size along the second mode. To return a tensor, see the
parafac2_to_tensor
function instead.shapeThe decomposition is on the form such that the ith frontal slice, , of is given by
where is the diagonal matrix whose nonzero entries are equal to the th row of the factor matrix , is a factor matrix such that the cross product matrix is constant for all , and is a factor matrix. To compute this decomposition, we reformulate the expression for such that
where is a orthogonal matrix and is a matrix.
An alternative formulation of the PARAFAC2 decomposition is that the tensor element is given by
with the same constraints hold for 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 , and described above
 projection_matricesList of projection matrices used to create evolving
 factors.
Returns:  List[ndarray]
A list of full tensors of shapes [P[i].shape[1], C.shape[1]], where P is the projection matrices and C is the last factor matrix of the Parafac2Tensor.