RDFTensor (version 1.3)

cp_nmu: Compute nonnegative CP with multiplicative updates(NMU)

Description

computes an estimate of the best rank-R PARAFAC model of a tensor X with nonnegative constraints on the factors. This version uses the Lee & Seung multiplicative updates from their NMF algorithm. Translated from cp_nmu.m : MATLAB Tensor Toolbox

Usage

cp_nmu(X, R, opts = list())

Arguments

X

is a sparse tensor (a LIST containing subs, vals and size)

R

The rank of the factorization

opts

a list containing the options for the algorithm like maxiters:maximum iterations, tol:tolerance .. etc.

Value

P

the factorization of X as a LIST representing Kruskal Tensor (lambda and u)

Uinit

the initial solution

stats

statistics about the solution like the running time of each step and the error.

fit

fraction explained by the model.

References

-Brett W. Bader, Tamara G. Kolda and others. MATLAB Tensor Toolbox, Version [v3.0]. Available online at https://www.tensortoolbox.org, 2015.

-Lee, Daniel D., and H. Sebastian Seung. "Algorithms for non-negative matrix factorization." In Advances in neural information processing systems, pp. 556-562. 2001.

See Also

cp_apr serial_parCube rescal cp_als

Examples

Run this code
# NOT RUN {
subs=matrix(c(5,1,1,
              3,1,2,
              1,1,3,
              2,1,3,
              4,1,3,
              6,1,3,
              1,1,4,
              2,1,4,
              4,1,4,
              6,1,4,
              1,2,1,
              3,2,1,
              5,2,1),byrow=TRUE,ncol=3)

X=list(subs=subs,vals=rep(1,nrow(subs)),size=c(6,2,4))
set.seed(123)
P1=cp_nmu(X,2)

# }

Run the code above in your browser using DataCamp Workspace