LDA++
|
#include <MStepInterface.hpp>
Public Member Functions | |
virtual void | m_step (std::shared_ptr< parameters::Parameters > parameters)=0 |
virtual void | doc_m_step (const std::shared_ptr< corpus::Document > doc, const std::shared_ptr< parameters::Parameters > v_parameters, std::shared_ptr< parameters::Parameters > m_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) |
Interface that defines an M-step iteration for any LDA inference.
The maximization step maximizes the likelihood (actually the Evidence Lower Bound) of the data by changing the parameters and using the variational parameters as constants. In classical LDA this step computes the distribution over words for all topics using the variational parameters \(\phi\) and \(\gamma\).
|
pure virtual |
Perform calculations for a specific document.
The variational parameters are only passed to the maximization step in this method. In other implementations this method is usually called sufficient statistics.
This method allows for the implementation of online LDA inference methods.
doc | A single document |
v_parameters | The variational parameters computed in the e-step |
m_parameters | Model parameters could be changed in case of online methods |
Implemented in ldaplusplus::em::FastOnlineSupervisedMStep< Scalar >, ldaplusplus::em::FastSupervisedMStep< Scalar >, ldaplusplus::em::SupervisedMStep< Scalar >, ldaplusplus::em::UnsupervisedMStep< Scalar >, ldaplusplus::em::CorrespondenceSupervisedMStep< Scalar >, ldaplusplus::em::SemiSupervisedMStep< Scalar >, and ldaplusplus::em::MultinomialSupervisedMStep< Scalar >.
|
pure virtual |
Maximize the ELBO.
This function usually changes the passed in parameters.
parameters | Model parameters (maybe changed after call) |
Implemented in ldaplusplus::em::FastOnlineSupervisedMStep< Scalar >, ldaplusplus::em::FastSupervisedMStep< Scalar >, ldaplusplus::em::SupervisedMStep< Scalar >, ldaplusplus::em::UnsupervisedMStep< Scalar >, ldaplusplus::em::CorrespondenceSupervisedMStep< Scalar >, and ldaplusplus::em::MultinomialSupervisedMStep< Scalar >.