tensorly.cp_tensor
.cp_normalize

cp_normalize
(cp_tensor)[source] Returns cp_tensor with factors normalised to unit length
Turns
factors = [U_1, ... U_n]
into[weights; V_1, ... V_n]
, where the columns of each V_k are normalized to unit Euclidean length from the columns of U_k with the normalizing constants absorbed into weights. In the special case of a symmetric tensor, weights holds the eigenvalues of the tensor.Parameters:  cp_tensorCPTensor = (weight, factors)
factors is list of matrices, all with the same number of columns i.e.:
for u in U: u[i].shape == (s_i, R)
where R is fixed while s_i can vary with i
Returns:  CPTensor = (normalisation_weights, normalised_factors)