Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/serial_parCube.R
ParCube uses sampling to reduce the problem then apply one of the tensor factorization methods:
cp_apr
, cp_als
, cp_nmu
on the small tensor.
It is suitable for large sparse tensors.
1 | serial_parCube(X, R, sample_factor, repetitions, opts = NULL)
|
X |
is a sparse tensor (a LIST containing subs, vals and size) |
R |
The rank of the factorization |
sample_factor |
[s1 s2 s3] such that each sampled tensor is of size [I/s1 J/s2 K/s3] |
repetitions |
number of sampling repetitions |
opts |
a list containing the options for the algorithm like maxiters:maximum iterations, tol:tolerance .. etc. |
opts: structure that stores options of the algorithm. For default, leave blank or use 'default_parcube_options()'. opts.p: percentage of common indices opts.nonneg: nonnegativity constraint enforced (binary) opts.loss: loss function (opts: 'fro' for Frobenius norm 'kl' for KL-divergence) opts.weights: function of calculating sampling weights (opts: 'sum_abs' for sum of absolute values or 'sum_squares' for sum of squares) opts.normalize: normalize the factor matrices to unit norm per column (binary); opts.tolerance: the numerical tolerance of the algorithm (everything smaller than that is considered zero) opts.internal_tolerance: the tolerance of the solvers used interally opts.num_restarts: number of repetitions of each decomposition of each sample
lambda |
lambdas of Kruskal tensor |
u |
LIST of A, B and C factor matrices for mode 1, 2 and 3 respectively. |
Abdelmoneim Amer Desouki
-Brett W. Bader, Tamara G. Kolda and others. MATLAB Tensor Toolbox, Version [v3.0]. Available online at https://www.tensortoolbox.org, 2015.
-Papalexakis, Evangelos E., Christos Faloutsos, and Nicholas D. Sidiropoulos. "Parcube: Sparse parallelizable tensor decompositions." Machine Learning and Knowledge Discovery in Databases. Springer Berlin Heidelberg, 2012. 521-536.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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)
opts = default_parcube_options();
opts[['loss']]='fro'
opts[['nonneg']]='1'#nmu
P1=serial_parCube(X,2,1,2,opts=opts)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.