bnmf-algs
|
Computer type that will compute the next collapsed gibbs sample when its operator() is invoked. More...
#include <collapsed_gibbs.hpp>
Public Member Functions | |
CollapsedGibbsComputer (const matrix_t< T > &X, size_t z, const alloc_model::Params< Scalar > &model_params, size_t max_iter, double eps) | |
Construct a new CollapsedGibbsComputer. More... | |
void | operator() (size_t curr_step, tensor_t< T, 3 > &S_prev) |
Function call operator that will compute the next tensor sample from the previous sample. More... | |
Computer type that will compute the next collapsed gibbs sample when its operator() is invoked.
CollapsedGibbsComputer will compute a new bnmf_algs::tensord<3> object from the previous sample when its operator() is invoked.
T | Type of the matrix/tensor entries. |
Scalar | Type of the scalars used as model parameters. |
|
inlineexplicit |
Construct a new CollapsedGibbsComputer.
X | Matrix \(X\) of size \(x \times y\) that will be used during sampling. |
z | Depth of the output tensor \(S\) with size \(x \times y \times z\). |
model_params | Allocation model parameters. See bnmf_algs::alloc_model::Params<double>. |
max_iter | Maximum number of iterations. |
eps | Floating point epsilon value to be used to prevent division by 0 errors. |
|
inline |
Function call operator that will compute the next tensor sample from the previous sample.
After this function exits, the object referenced by S_prev will be modified to store the next sample.
Note that CollapsedGibbsComputer object satisfies the bnmf_algs::util::Generator and bnmf_algs::util::ComputationIterator Computer interface. Hence, a sequence of samples may be generated efficiently by using this Computer with bnmf_algs::util::Generator or bnmf_algs::util::ComputationIterator.
curr_step | Current step of collapsed gibbs computation. |
S_prev | Previously computed sample to modify in-place. |