Overview

Work-in-progress

This page of the docs is still a work-in-progress. Check back later!

GCPDecompositionsModule

Generalized CP Decomposition module. Provides approximate CP tensor decomposition with respect to general losses.

source
GCPDecompositions.gcpFunction
gcp(X::Array, r;
    loss = GCPLosses.LeastSquares(),
    constraints = default_constraints(loss),
    algorithm = default_algorithm(X, r, loss, constraints),
    init = default_init(X, r, loss, constraints, algorithm))

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

Keyword arguments:

  • constraints : a Tuple of constraints on the factor matrices U = (U[1],...,U[N]).
  • algorithm : algorithm to use

Conventional CP corresponds to the default GCPLosses.LeastSquares() loss with the default of no constraints (i.e., constraints = ()).

If the LossFunctions.jl package is also loaded, loss can also be a loss function from that package. Check GCPDecompositions.LossFunctionsExt.SupportedLosses to see what losses are supported.

See also: CPD, GCPLosses, GCPConstraints, GCPAlgorithms.

source
GCPDecompositions.CPDType
CPD

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

source
GCPDecompositions.default_algorithmFunction
default_algorithm(X, r, loss, constraints)

Return a default algorithm for the data tensor X, rank r, loss function loss, and tuple of constraints constraints.

See also: gcp.

source
GCPDecompositions.default_initFunction
default_init([rng=default_rng()], X, r, loss, constraints, algorithm)

Return a default initialization for the data tensor X, rank r, loss function loss, tuple of constraints constraints, and algorithm algorithm, using the random number generator rng if needed.

See also: gcp.

source