Einsums/Decomposition/CP.hpp#
Defined in header Einsums/Decomposition/CP.hpp.
See Overview for a list of names and headers that are part of the public Einsums API.
-
namespace einsums
-
namespace decomposition#
Functions
-
template<TensorConcept TTensor, VectorConcept WTensor>
Tensor<ValueTypeT<TTensor>, TensorRank<TTensor>> weight_tensor(TTensor const &tensor, WTensor const &weights)# “Weight” a tensor for weighted CANDECOMP/PARAFAC decompositions (returns a copy) by input weights
-
template<size_t TRank, typename TType, typename Alloc>
Tensor<TType, TRank> parafac_reconstruct(std::vector<Tensor<TType, 2>, Alloc> const &factors)# Reconstructs a tensor given a CANDECOMP/PARAFAC decomposition
factors = The decomposed CANDECOMP matrices (dimension: [dim[i], rank])
-
template<size_t TRank, typename TType, typename Alloc>
BufferVector<Tensor<TType, 2>> initialize_cp(std::vector<Tensor<TType, 2>, Alloc> &folds, size_t rank)#
-
template<template<typename, size_t> typename TTensor, size_t TRank, typename TType = double>
BufferVector<Tensor<TType, 2>> parafac(TTensor<TType, TRank> const &tensor, size_t rank, int n_iter_max = 100, double tolerance = 1.e-8)# CANDECOMP/PARAFAC decomposition via alternating least squares (ALS). Computes a rank-
rank
decomposition oftensor
such that:tensor = [|weights; factor[0], …, factors[-1] |].
-
template<template<typename, size_t> typename TTensor, size_t TRank, typename TType = double>
BufferVector<Tensor<TType, 2>> weighted_parafac(TTensor<TType, TRank> const &tensor, TTensor<TType, 1> const &weights, size_t rank, int n_iter_max = 100, double tolerance = 1.e-8)# Weighted CANDECOMP/PARAFAC decomposition via alternating least squares (ALS). Computes a rank-
rank
decomposition oftensor
such that:tensor = [| factor[0], …, factors[-1] |]. weights = The weights to multiply the tensor by
-
template<TensorConcept TTensor, VectorConcept WTensor>
-
namespace decomposition#