bnmf-algs
Classes | Namespaces | Functions
alloc_model_funcs.hpp File Reference

Go to the source code of this file.

Classes

class  bnmf_algs::details::TotalMarginalCalculator< Integer, Scalar >
 Class to compute total \(p(X|\Theta) = \sum_S p(X|S)p(S|\Theta)\) for all possible allocation tensors while storing shared state between function invocations. More...
 

Namespaces

 bnmf_algs
 Main namespace for bnmf-algs library.
 
 bnmf_algs::alloc_model
 Namespace that contains functions related to Allocation Model [5].
 
 bnmf_algs::details
 Namespace that contains types and functions for internal computations.
 

Functions

template<typename T , typename Scalar >
double bnmf_algs::alloc_model::log_marginal_S (const tensor_t< T, 3 > &S, const Params< Scalar > &model_params)
 Compute the log marginal of tensor S with respect to the given distribution parameters. More...
 
template<typename T , typename Scalar >
double bnmf_algs::details::compute_first_term (const tensor_t< T, 3 > &S, const std::vector< Scalar > &alpha)
 Compute the first term of the sum when calculating log marginal of S. More...
 
template<typename T , typename Scalar >
double bnmf_algs::details::compute_second_term (const tensor_t< T, 3 > &S, const std::vector< Scalar > &beta)
 Compute the second term of the sum when calculating log marginal of S. More...
 
template<typename T , typename Scalar >
double bnmf_algs::details::compute_third_term (const tensor_t< T, 3 > &S, Scalar a, Scalar b)
 Compute the third term of the sum when calculating log marginal of S. More...
 
template<typename T >
double bnmf_algs::details::compute_fourth_term (const tensor_t< T, 3 > &S)
 Compute the fourth term of the sum when calculating log marginal of S. More...
 
template<typename T , typename Scalar >
std::tuple< matrix_t< T >, matrix_t< T >, vector_t< T > > bnmf_algs::alloc_model::bnmf_priors (const shape< 3 > &tensor_shape, const Params< Scalar > &model_params)
 Return prior matrices W, H and vector L according to the Bayesian NMF allocation model using distribution parameters. More...
 
template<typename T >
tensor_t< T, 3 > bnmf_algs::alloc_model::sample_S (const matrix_t< T > &prior_W, const matrix_t< T > &prior_H, const vector_t< T > &prior_L)
 Sample a tensor S from generative Bayesian NMF model using the given priors. More...
 
template<typename Integer , typename Scalar >
double bnmf_algs::alloc_model::total_log_marginal (const matrix_t< Integer > &X, const Params< Scalar > &model_params)
 Calculate total marginal value, \(p(X|\Theta) = \sum_S p(X|S)p(S|\Theta)\) where \(Theta\) is model parameters. More...