GCPDecompositions: Generalized CP Decompositions

Documentation for GCPDecompositions.

👋 This package provides research code and work is ongoing. If you are interested in using it in your own research, I'd love to hear from you and collaborate! Feel free to write: hong@udel.edu

Please cite the following papers for this technique:

David Hong, Tamara G. Kolda, Jed A. Duersch. "Generalized Canonical Polyadic Tensor Decomposition", SIAM Review 62:133-163, 2020. https://doi.org/10.1137/18M1203626 https://arxiv.org/abs/1808.07452

Tamara G. Kolda, David Hong. "Stochastic Gradients for Large-Scale Tensor Decomposition", SIAM Journal on Mathematics of Data Science 2:1066-1095, 2020. https://doi.org/10.1137/19M1266265 https://arxiv.org/abs/1906.01687

In BibTeX form:

  title =        "Generalized Canonical Polyadic Tensor Decomposition",
  author =       "David Hong and Tamara G. Kolda and Jed A. Duersch",
  journal =      "{SIAM} Review",
  year =         "2020",
  volume =       "62",
  number =       "1",
  pages =        "133--163",
  DOI =          "10.1137/18M1203626",

  title =        "Stochastic Gradients for Large-Scale Tensor Decomposition",
  author =       "Tamara G. Kolda and David Hong",
  journal =      "{SIAM} Journal on Mathematics of Data Science",
  year =         "2020",
  volume =       "2",
  number =       "4",
  pages =        "1066--1095",
  DOI =          "10.1137/19M1266265",



Tensor decomposition type for the canonical polyadic decompositions (CPD) of a tensor (i.e., a multi-dimensional array) A. This is the return type of gcp(_), the corresponding tensor decomposition function.

If M::CPD is the decomposition object, the weights λ and the factor matrices U = (U[1],...,U[N]) can be obtained via M.λ and M.U, such that A = Σ_j λ[j] U[1][:,j] ∘ ⋯ ∘ U[N][:,j].

gcp(X::Array, r[, func, grad, lower]) -> CPD

Compute an approximate rank-r CP decomposition of the tensor X with respect to a general loss and return a CPD object.


  • X : multi-dimensional tensor/array to approximate/decompose
  • r : number of components for the CPD
  • func : loss function, default = (x, m) -> (m - x)^2
  • grad : loss function derivative, default uses ForwardDiff.jl
  • lower : lower bound for factor matrix entries, default = -Inf