Public Member Functions | List of all members
ldaplusplus::em::EStepInterface< Scalar > Class Template Referenceabstract

#include <EStepInterface.hpp>

Inheritance diagram for ldaplusplus::em::EStepInterface< Scalar >:
ldaplusplus::events::EventDispatcherComposition ldaplusplus::em::AbstractEStep< Scalar > ldaplusplus::em::SemiSupervisedEStep< Scalar > ldaplusplus::em::CorrespondenceSupervisedEStep< Scalar > ldaplusplus::em::FastSupervisedEStep< Scalar > ldaplusplus::em::MultinomialSupervisedEStep< Scalar > ldaplusplus::em::SupervisedEStep< Scalar > ldaplusplus::em::UnsupervisedEStep< Scalar >

Public Member Functions

virtual std::shared_ptr< parameters::Parametersdoc_e_step (const std::shared_ptr< corpus::Document > doc, const std::shared_ptr< parameters::Parameters > parameters)=0
virtual void e_step ()=0
- Public Member Functions inherited from ldaplusplus::events::EventDispatcherComposition
std::shared_ptr< EventDispatcherInterfaceget_event_dispatcher ()
void set_event_dispatcher (std::shared_ptr< EventDispatcherInterface > dispatcher)

Detailed Description

template<typename Scalar>
class ldaplusplus::em::EStepInterface< Scalar >

Interface that defines an E-step iteration for any LDA inference.

The expectation step maximizes the likelihood (actually the Evidence Lower Bound) of the data given constant parameters. In variational inference this is achieved by changing the free variational parameters. In classical LDA this step computes \(\phi\) and \(\gamma\) for every document given the distribution over words for all topics, usually \(\beta\) in literature.

Member Function Documentation

template<typename Scalar >
virtual std::shared_ptr<parameters::Parameters> ldaplusplus::em::EStepInterface< Scalar >::doc_e_step ( const std::shared_ptr< corpus::Document doc,
const std::shared_ptr< parameters::Parameters parameters 
pure virtual

Maximize the ELBO.

docA single document
parametersAn instance of class Parameters, which contains all necessary model parameters for e-step's implementation
The variational parameters for the current model, after e-step is completed

Implemented in ldaplusplus::em::CorrespondenceSupervisedEStep< Scalar >, ldaplusplus::em::FastSupervisedEStep< Scalar >, ldaplusplus::em::SupervisedEStep< Scalar >, ldaplusplus::em::UnsupervisedEStep< Scalar >, ldaplusplus::em::MultinomialSupervisedEStep< Scalar >, and ldaplusplus::em::SemiSupervisedEStep< Scalar >.

template<typename Scalar >
virtual void ldaplusplus::em::EStepInterface< Scalar >::e_step ( )
pure virtual

Perform actions that should be performed once for each epoch for the whole corpus. One use of this method is so that the e steps can know which epoch they are running for.

Implemented in ldaplusplus::em::FastSupervisedEStep< Scalar >, ldaplusplus::em::SemiSupervisedEStep< Scalar >, and ldaplusplus::em::AbstractEStep< Scalar >.

The documentation for this class was generated from the following file: