LDA++
|
#include <AbstractEStep.hpp>
Public Member Functions | |
AbstractEStep (int random_state) | |
virtual void | e_step () override |
Public Member Functions inherited from ldaplusplus::em::EStepInterface< Scalar > | |
virtual std::shared_ptr< parameters::Parameters > | doc_e_step (const std::shared_ptr< corpus::Document > doc, const std::shared_ptr< parameters::Parameters > parameters)=0 |
Public Member Functions inherited from ldaplusplus::events::EventDispatcherComposition | |
std::shared_ptr< EventDispatcherInterface > | get_event_dispatcher () |
void | set_event_dispatcher (std::shared_ptr< EventDispatcherInterface > dispatcher) |
Protected Member Functions | |
bool | converged (const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gamma_old, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gamma, Scalar tolerance) |
PRNG & | get_prng () |
A base class that provides few common functionalities for implementing an E step.
ldaplusplus::em::AbstractEStep< Scalar >::AbstractEStep | ( | int | random_state | ) |
Require a random state to be passed from the extending classes.
random_state | An initial seed value for random number generation. |
|
protected |
Check for convergence based on the mean relative change of the variational parameter \(\gamma\).
gamma_old | The gamma of the previous iteration. |
gamma | The gamma of this iteration. |
tolerance | The threshold below which we declare convergence. |
|
inlineoverridevirtual |
Implement an empty e_step because almost nobody needs to perform some action at the end of each corpus epoch.
Implements ldaplusplus::em::EStepInterface< Scalar >.
Reimplemented in ldaplusplus::em::FastSupervisedEStep< Scalar >.
|
inlineprotected |
Return a PRNG for use with any distribution.
Although this isn't all that different from making random_ protected it could allow for future change of the object returned since it can be anything that satisfies the UniformRandomBitGenerator (see: http://en.cppreference.com/w/cpp/concept/UniformRandomBitGenerator).