ensign.cp_decomp.cp_apr

cp_apr(sptensor, rank, out_dir=None, seed=0, max_outer_iter=100, max_inner_iter=10, stop_tol=0.0001, mem_limit_gb=2, output_init_guess=False, verbose=False, gen_backtrack=False)[source]

Performs a CP decomposition using the alternating Poisson regression (APR) method. [1] [2]

Parameters
sptensorSPTensor or str

Tensor to decompose. If sptensor is of type str, it should contain a path to a directory containing an SPTensor or directly to a tensor_data.txt file.

rankint

Rank of the decomposition.

out_dirstr

Path to directory where decomposition results will be written. If not set, the decomposition will not be written to disk.

Returns
decompCPDecomp

Results of the decomposition.

Other Parameters
seedint, optional

Random seed used to initialize decomposition. Default value is 0.

max_outer_iterint, optional

Maximum iterations before stopping decomposition. Default value is 200.

max_inner_iterint, optional

Maximum inner iterations per outer iteration. Default value is 10.

stop_tolfloat, optional

Minimum change in KKT violation required for convergence. Default value is 1.0e-4.

mem_limit_gbint, optional

Maximum memory used during decomposition, in GiB. Default value is 2.

output_init_guessbool, optional

Write the initial guess of decomposition to out_dir/input_<mode_id>.txt Default value is False.

verbosebool, optional

Output verbose decomposition progress to out_dir/output.txt Default value is False.

gen_backtrackbool, optional

Output component-wise backtracking information to out_dir/cpd_backtrack.txt Default value is False.

Raises
Exception

If there is a problem performing the decomposition.

See also

ensign.cp_decomp.CPDecomp

CP decomposition class

ensign.sptensor.SPTensor

Sparse tensor class

References

1

Chi, E., Kolda, T., “On Tensors, Sparsity, and Nonnegative Factorizations,” SIAM Journal on Matrix Analysis and Applications 33.4, pp. 1272-1299, 2012.

2

Baskaran, M., Meister, B., Vasilache, N., Lethin, R., “Efficient and Scalable Computations with Sparse Tensors,” IEEE HPEC, 2012.