Nonnegative CP Tensor Decomposition by Alternating Least Squares (BCD)

tensortools.ncp_bcd(X, rank, random_state=None, init='rand', **options)

Fits nonnegative CP Decomposition using the Block Coordinate Descent (BCD) Method.

Parameters:
  • X ((I_1, .., I_N) array_like) – A real array with nonnegative entries and X.ndim >= 3.
  • rank (integer) – The rank sets the number of components to be computed.
  • random_state (integer, RandomState instance or None, optional (default None)) – If integer, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
  • init (str, or KTensor, optional (default 'rand').) – Specifies initial guess for KTensor factor matrices. If 'randn', Gaussian random numbers are used to initialize. If 'rand', uniform random numbers are used to initialize. If KTensor instance, a copy is made to initialize the optimization.
  • options (dict, specifying fitting options.) –
    tol : float, optional (default tol=1E-5)
    Stopping tolerance for reconstruction error.
    max_iter : integer, optional (default max_iter = 500)
    Maximum number of iterations to perform before exiting.
    min_iter : integer, optional (default min_iter = 1)
    Minimum number of iterations to perform before exiting.
    max_time : integer, optional (default max_time = np.inf)
    Maximum computational time before exiting.
    verbose : bool {'True', 'False'}, optional (default verbose=True)
    Display progress.
Returns:

result – Object which holds the fitted results. It provides the factor matrices in form of a KTensor, result.factors.

Return type:

FitResult instance

Notes

This implemenation is using the Block Coordinate Descent Method.

References

Xu, Yangyang, and Wotao Yin. “A block coordinate descent method for regularized multiconvex optimization with applications to negative tensor factorization and completion.” SIAM Journal on imaging sciences 6.3 (2013): 1758-1789.

Examples