tensorly.decomposition
.CPPower
-
class
CPPower
(rank, n_repeat=10, n_iteration=10, verbose=0)[source] CP Decomposition via Robust Tensor Power Iteration
Parameters: - tensortl.tensor
input tensor to decompose
- rankint
rank of the decomposition (number of rank-1 components)
- n_repeatint, default is 10
number of initializations to be tried
- n_iterationint, default is 10
number of power iterations
- verbosebool
level of verbosity
Returns: - (weights, factors)
- weights1-D tl.tensor of length rank
contains the eigenvalue of each eigenvector
- factorslist of 2-D tl.tensor of shape (size, rank)
Each column of each factor corresponds to one eigenvector
-
fit_transform
(tensor)[source] Decompose an input tensor
Parameters: - tensortensorly tensor
input tensor to decompose
Returns: - CPTensor
decomposed tensor