LDA++
SemiSupervisedEStep.hpp
1 #ifndef _LDAPLUSPLUS_EM_SEMISUPERVISEDESTEP_HPP_
2 #define _LDAPLUSPLUS_EM_SEMISUPERVISEDESTEP_HPP_
3 
4 
5 #include <memory>
6 
7 #include "ldaplusplus/em/EStepInterface.hpp"
8 
9 namespace ldaplusplus {
10 namespace em {
11 
12 
22 template <typename Scalar>
23 class SemiSupervisedEStep : public EStepInterface<Scalar>
24 {
25  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> MatrixX;
26  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> VectorX;
27 
28  public:
35  std::shared_ptr<EStepInterface<Scalar> > supervised_step,
36  std::shared_ptr<EStepInterface<Scalar> > unsupervised_step
37  );
38  virtual ~SemiSupervisedEStep();
39 
45  std::shared_ptr<parameters::Parameters> doc_e_step(
46  const std::shared_ptr<corpus::Document> doc,
47  const std::shared_ptr<parameters::Parameters> parameters
48  ) override;
49 
53  void e_step() override;
54 
55  private:
56  std::shared_ptr<EStepInterface<Scalar> > supervised_step_;
57  std::shared_ptr<EStepInterface<Scalar> > unsupervised_step_;
58 
59  std::shared_ptr<events::EventListenerInterface> event_forwarder_;
60 };
61 
62 } // namespace em
63 } // namespace ldaplusplus
64 
65 #endif // _LDAPLUSPLUS_EM_SEMISUPERVISEDESTEP_HPP_
std::shared_ptr< parameters::Parameters > doc_e_step(const std::shared_ptr< corpus::Document > doc, const std::shared_ptr< parameters::Parameters > parameters) override
Definition: SemiSupervisedEStep.cpp:31
Definition: SemiSupervisedEStep.hpp:23
Definition: EStepInterface.hpp:24
void e_step() override
Definition: SemiSupervisedEStep.cpp:44
Definition: Document.hpp:11
SemiSupervisedEStep(std::shared_ptr< EStepInterface< Scalar > > supervised_step, std::shared_ptr< EStepInterface< Scalar > > unsupervised_step)
Definition: SemiSupervisedEStep.cpp:8