|
bool | converged (const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gamma_old, const Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &gamma, Scalar tolerance) |
|
PRNG & | get_prng () |
|
template<typename Scalar >
- Parameters
-
e_step_iterations | The max number of times to alternate between maximizing for \(\gamma\) and for \(\phi\). |
e_step_tolerance | The minimum relative change in the variational parameter \(\gamma\). |
mu | The uniform Dirichlet prior of \(\eta\), practically is a smoothing parameter during the maximization of \(\eta\). |
eta_weight | A weighting parameter that either increases or decreases the influence of the supervised part. |
compute_likelihood | The percentage of documents to compute likelihood for (1.0 means compute for every document) |
random_state | An initial seed value for any random numbers needed |
template<typename Scalar >
Maximize the ELBO w.r.t. \(\phi\) and \(\gamma\).
The following steps are the mathematics that are implemented where \(\beta\) are the over words topics distributions, \(\alpha\) is the Dirichlet prior, \(\eta\) are the logistic regression parameters, \(i\) is the topic subscript, \(n\) is the word subscript, \(\hat{y}\) is the class subscript, \(y\) is the document's class, \(w_n\) is n-th word vocabulary index, \(m \) is a weighting parameter used to adjust the influence of the supervised part and finally \(\Psi(\cdot)\) is the first derivative of the \(\log \Gamma\) function.
- Repeat until convergence of \(\gamma\).
- Compute \(\phi_{ni} \propto \beta_{iw_n}\eta_{yi}^m\exp\left( \Psi(\gamma_i)\right)\)
- Compute \(\gamma_i = \alpha_i + \sum_n^N \phi_{ni} \)
- Parameters
-
doc | A single document. |
parameters | An instance of class Parameters, which contains all necessary model parameters for e-step's implementation. |
- Returns
- The variational parameters for the current model, after e-step is completed.
Implements ldaplusplus::em::EStepInterface< Scalar >.
The documentation for this class was generated from the following files: