bnmf-algs
Namespaces | Functions
online_EM_funcs.hpp File Reference

Go to the source code of this file.

Namespaces

 bnmf_algs
 Main namespace for bnmf-algs library.
 
 bnmf_algs::details
 Namespace that contains types and functions for internal computations.
 
 bnmf_algs::details::online_EM
 Namespace containing online_EM algorithm related functions.
 

Functions

template<typename T >
size_t bnmf_algs::details::online_EM::init_nan_values (matrix_t< T > &X)
 Initialize all NaN values in the given matrix with the mean of the remaining values that are different than NaN. More...
 
template<typename Scalar >
std::pair< matrix_t< Scalar >, matrix_t< Scalar > > bnmf_algs::details::online_EM::init_alpha_beta (const std::vector< alloc_model::Params< Scalar >> &param_vec, size_t y)
 Initialize each entry of alpha and beta matrices with the given model parameters. More...
 
template<typename T >
std::tuple< matrix_t< T >, matrix_t< T >, vector_t< T > > bnmf_algs::details::online_EM::init_S_xx (const matrix_t< T > &X_full, size_t z, const std::vector< size_t > &ii, const std::vector< size_t > &jj)
 Initialize S_pjk, S_ipk matrices and S_ppk vector from a Dirichlet distribution with all parameters equal to 1. More...
 
template<typename T , typename Scalar , typename PsiFunction >
void bnmf_algs::details::online_EM::update_logW (const matrix_t< Scalar > &alpha, const matrix_t< T > &S_ipk, const vector_t< Scalar > &alpha_pk, const vector_t< T > &S_ppk, const PsiFunction &psi_fn, matrix_t< double > &logW)
 Perform an update on logW matrix. More...
 
template<typename T , typename Scalar , typename PsiFunction >
void bnmf_algs::details::online_EM::update_logH (const matrix_t< Scalar > &beta, const matrix_t< T > &S_pjk, const Scalar b, const PsiFunction &psi_fn, matrix_t< double > &logH)
 Perform an update on logW matrix. More...
 
template<typename T >
std::tuple< std::vector< size_t >, std::vector< size_t >, std::vector< T > > bnmf_algs::details::online_EM::find_nonzero (const matrix_t< T > &X)
 Find nonzero entries and their indices in the given matrix and return indices and values as vectors. More...
 
template<typename T >
double bnmf_algs::details::online_EM::update_allocation (const std::vector< size_t > &ii, const std::vector< size_t > &jj, const std::vector< T > &xx, bld::EMResult< T > &res, vector_t< T > &S_ppk)
 Update the current allocation by performing a maximization step for each nonzero entry of the original input matrix. More...
 
template<typename T , typename Scalar >
double bnmf_algs::details::online_EM::delta_log_PS (const matrix_t< Scalar > &alpha, const matrix_t< Scalar > &beta, const matrix_t< T > &S_ipk, const matrix_t< T > &S_pjk, const vector_t< Scalar > &alpha_pk, const vector_t< T > &S_ppk, Scalar b)
 Compute the difference in log_PS value computed using the given model variables. More...