ensign.cp_decomp.cp_apr_pdnr¶
-
cp_apr_pdnr(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, load_balance=0, verbose=False, gen_backtrack=False)[source]¶ Performs a CP decomposition using alternating Poisson regression (APR) with projected damped Newton row (PDNR) subproblem. [1]
- 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>.txtDefault value isFalse.- load_balanceint, optional
The load balancing technique to use for parallel execution.
ensign.constants.NO_LOAD_BALANCE(default) is no load balancing,ensign.constants.LOAD_BALANCEis standard load balancing, andensign.constants.LOAD_BALANCE_UNSORTEDis unsorted load balancing.- verbosebool, optional
Output verbose decomposition progress to
out_dir/output.txtDefault value isFalse.- gen_backtrackbool, optional
Output component-wise backtracking information to
out_dir/cpd_backtrack.txtDefault value isFalse.
- Raises
- Exception
If there is a problem performing the decomposition.
See also
ensign.cp_decomp.CPDecompCP decomposition class
ensign.sptensor.SPTensorSparse tensor class
References
- 1
Hansen, S., Plantenga, T., Kolda, T., “Newton-based Optimization for Kullback-Leibler Nonnegative Tensor Factorizations,” Optimization Methods and Software 30(5), pp. 1002-1029, 2015.