RDFTensor (version 1.3)

serial_parCube: Serial 3-mode ParCube algorithm for memory resident tensors

Description

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.

Usage

serial_parCube(X, R, sample_factor, repetitions, opts = NULL)

Arguments

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.

Value

lambda

lambdas of Kruskal tensor

u

LIST of A, B and C factor matrices for mode 1, 2 and 3 respectively.

%% ...

Details

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

References

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

See Also

cp_apr cp_als rescal cp_nmu

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)
 opts = default_parcube_options();
 opts[['loss']]='fro'
 opts[['nonneg']]='1'#nmu
 P1=serial_parCube(X,2,1,2,opts=opts)

# }

Run the code above in your browser using DataLab