|
template<typename T , typename Scalar > |
double | 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 | 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 | 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 | 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 > |
void | update_X_hat (const matrix_t< T > &nu, const matrix_t< T > &mu, matrix_t< T > &X_hat) |
|
template<typename T > |
void | update_orig_over_appr (const matrix_t< T > &X, const matrix_t< T > &X_hat, const matrix_t< T > &eps_mat, matrix_t< T > &orig_over_appr) |
|
template<typename T > |
void | update_orig_over_appr_squared (const matrix_t< T > &X, const matrix_t< T > &X_hat, const matrix_t< T > &eps_mat, matrix_t< T > &orig_over_appr_squared) |
|
template<typename T > |
void | update_S (const matrix_t< T > &orig_over_appr, const matrix_t< T > &nu, const matrix_t< T > &mu, tensor_t< T, 3 > &S) |
|
template<typename T > |
void | update_alpha_eph (const vector_t< T > &alpha, const tensor_t< T, 3 > &S, matrix_t< T > &alpha_eph) |
|
template<typename T > |
void | update_beta_eph (const vector_t< T > &beta, const tensor_t< T, 3 > &S, matrix_t< T > &beta_eph) |
|
template<typename T > |
void | update_grad_plus (const matrix_t< T > &beta_eph, const tensor_t< T, 3 > &S, tensor_t< T, 3 > &grad_plus) |
|
template<typename T > |
void | update_grad_minus (const matrix_t< T > &alpha_eph, matrix_t< T > &grad_minus) |
|
template<typename T > |
void | update_nu (const matrix_t< T > &orig_over_appr, const matrix_t< T > &orig_over_appr_squared, const matrix_t< T > &mu, const tensor_t< T, 3 > &grad_plus, const matrix_t< T > &grad_minus, double eps, matrix_t< T > &nu) |
|
template<typename T > |
static void | update_mu (const matrix_t< T > &orig_over_appr, const matrix_t< T > &orig_over_appr_squared, const matrix_t< T > &nu, const tensor_t< T, 3 > &grad_plus, const matrix_t< T > &grad_minus, double eps, matrix_t< T > &mu) |
|
template<typename T , typename Scalar > |
void | check_bld_params (const matrix_t< T > &X, size_t z, const alloc_model::Params< Scalar > &model_params) |
| Do parameter checks on BLD computing function parameters and throw an assertion error if the parameters are incorrect. More...
|
|
template<typename T , typename Scalar > |
void | check_EM_params (const matrix_t< T > &X, const std::vector< alloc_model::Params< Scalar >> ¶m_vec) |
| Do parameter checks on EM algorithms for solving the BLD problem. More...
|
|
template<typename Real > |
Real | gsl_psi_wrapper (Real x) |
| A template wrapper function around gsl_sf_psi. More...
|
|
template<typename T > |
void | check_sample_ones_params (const matrix_t< T > &X) |
|
template<typename IntIterator > |
void | right_partition (IntIterator begin, IntIterator end, IntIterator all_begin, IntIterator all_end, std::vector< std::pair< size_t, size_t >> &change_indices) |
| Partition the number stored at the beginning of the given sequence towards the end of the sequence by computing new partitions using exactly one increment and one decrement operations. More...
|
|
template<typename IntIterator > |
void | left_partition (IntIterator begin, IntIterator end, IntIterator all_begin, IntIterator all_end, std::vector< std::pair< size_t, size_t >> &change_indices) |
| Partition the number stored at the end of the given sequence towards the beginning of the sequence by computing new partitions using exactly one increment and one decrement operations. More...
|
|
Namespace that contains types and functions for internal computations.
Functions and classes in this namespace are not meant for direct usage by the users of bnmf-algs library; hence, behaviours of some functions may not be as expected. Additionally, some of these functions and types are not directly tested, and their behaviour is verified through correct behaviour of the API functions and types using them.
template<typename IntIterator >
void bnmf_algs::details::left_partition |
( |
IntIterator |
begin, |
|
|
IntIterator |
end, |
|
|
IntIterator |
all_begin, |
|
|
IntIterator |
all_end, |
|
|
std::vector< std::pair< size_t, size_t >> & |
change_indices |
|
) |
| |
Partition the number stored at the end of the given sequence towards the beginning of the sequence by computing new partitions using exactly one increment and one decrement operations.
This function partitions the number given at the end of the given sequence, *(end - 1) , towards the beginning, *begin . The indices of the values incremented/decremented to compute a new partition is pushed to the back of the given output vector, change_indices.
For n = *(end - 1) and k = end - begin , this function stores exactly \({n + k - 1}\choose{k - 1}\) different partitions between begin and end iterators. Increment/decrement indices of each partition is stored in the given output vector.
- Template Parameters
-
Integer | Integer type to use. |
- Parameters
-
begin | Beginning (leftmost iterator) of the sequence to store the partitions of the rightmost number. |
end | End (rightmost past one) of the sequence to store the partitions of the rightmost number. The number to partition must reside on the iterator before end. |
all_begin | Beginning of the whole sequence that stores complete partitions. This is the beginning iterator of the original vector that is modified to store various partitions of the original number. |
all_end | End of the whole sequence that stores complete partitions. |
change_indices | Output vector that stores increment/decrement index pairs to compute the next partition from previous one. |
template<typename IntIterator >
void bnmf_algs::details::right_partition |
( |
IntIterator |
begin, |
|
|
IntIterator |
end, |
|
|
IntIterator |
all_begin, |
|
|
IntIterator |
all_end, |
|
|
std::vector< std::pair< size_t, size_t >> & |
change_indices |
|
) |
| |
Partition the number stored at the beginning of the given sequence towards the end of the sequence by computing new partitions using exactly one increment and one decrement operations.
This function partitions the number given at the beginning of the given sequence, *begin , towards the end, *(end - 1) . The indices of the values incremented/decremented to compute a new partition is pushed to the back of the given output vector, change_indices.
For n = *begin and k = end - begin , this function stores exactly \({n + k - 1}\choose{k - 1}\) different partitions between begin and end iterators. Increment/decrement indices of each partition is stored in the given output vector.
- Template Parameters
-
Integer | Integer type to use. |
- Parameters
-
begin | Beginning (leftmost iterator) of the sequence to store the partitions of the leftmost number. (*begin) |
end | End (rightmost past one) of the sequence to store the partitions of the rightmost number. |
all_begin | Beginning of the whole sequence that stores complete partitions. This is the beginning iterator of the original vector that is modified to store various partitions of the original number. |
all_end | End of the whole sequence that stores complete partitions. |
change_indices | Output vector that stores increment/decrement index pairs to compute the next partition from previous one. |