cp_nmu: Compute nonnegative CP with multiplicative updates(NMU)

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/cp_nmu.R

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

1
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.

Author(s)

Abdelmoneim Amer Desouki

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)

RDFTensor documentation built on Jan. 16, 2021, 5:19 p.m.