non_negative_parafac(tensor, rank, n_iter_max=100, init='svd', svd='numpy_svd', tol=1e-06, random_state=None, verbose=0)

Non-negative CP decomposition

Uses multiplicative updates, see [R20]

This is the same as parafac(non_negative=True).


tensor : ndarray

rank : int

number of components

n_iter_max : int

maximum number of iteration

init : {‘svd’, ‘random’}, optional

svd : str, default is ‘numpy_svd’

function to use to compute the SVD, acceptable values in tensorly.SVD_FUNS

tol : float, optional

tolerance: the algorithm stops when the variation in the reconstruction error is less than the tolerance

random_state : {None, int, np.random.RandomState}

verbose : int, optional

level of verbosity


factors : ndarray list

list of positive factors of the CP decomposition element i is of shape (tensor.shape[i], rank)



Amnon Shashua and Tamir Hazan, “Non-negative tensor factorization with applications to statistics and computer vision”, In Proceedings of the International Conference on Machine Learning (ICML), pp 792-799, ICML, 2005