LDA++
CorrespondenceSupervisedEStep.hpp
1 #ifndef _LDAPLUSPLUS_EM_CORRESPONDENCESUPERVISEDESTEP_HPP_
2 #define _LDAPLUSPLUS_EM_CORRESPONDENCESUPERVISEDESTEP_HPP_
3 
4 #include "ldaplusplus/em/AbstractEStep.hpp"
5 
6 namespace ldaplusplus {
7 namespace em {
8 
9 
47 template<typename Scalar>
49 {
50  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixX;
51  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> VectorX;
52 
53  public:
70  size_t e_step_iterations = 10,
71  Scalar e_step_tolerance = 1e-2,
72  Scalar mu = 2.,
73  Scalar compute_likelihood = 1.0,
74  int random_state = 0
75  );
76 
104  std::shared_ptr<parameters::Parameters> doc_e_step(
105  const std::shared_ptr<corpus::Document> doc,
106  const std::shared_ptr<parameters::Parameters> parameters
107  ) override;
108 
109  private:
110  // The maximum number of iterations in E-step.
111  size_t e_step_iterations_;
112  // The convergence tolerance for the maximazation of the ELBO w.r.t.
113  // phi and gamma in E-step.
114  Scalar e_step_tolerance_;
115  // The Dirichlet prior for the class predicting parameters.
116  Scalar mu_;
117  // Compute the likelihood of that many documents (pecentile)
118  Scalar compute_likelihood_;
119 };
120 
121 } // namespace em
122 } // namespace ldaplusplus
123 
124 #endif // _LDAPLUSPLUS_EM_CORRESPONDENCESUPERVISEDESTEP_HPP__
CorrespondenceSupervisedEStep(size_t e_step_iterations=10, Scalar e_step_tolerance=1e-2, Scalar mu=2., Scalar compute_likelihood=1.0, int random_state=0)
Definition: CorrespondenceSupervisedEStep.cpp:10
Definition: CorrespondenceSupervisedEStep.hpp:48
std::shared_ptr< parameters::Parameters > doc_e_step(const std::shared_ptr< corpus::Document > doc, const std::shared_ptr< parameters::Parameters > parameters) override
Definition: CorrespondenceSupervisedEStep.cpp:25
Definition: AbstractEStep.hpp:21
Definition: Document.hpp:11