44 void CVariationalGaussianLikelihood::init()
47 "The mean of variational normal distribution\n",
51 "The variance of variational normal distribution\n",
54 SG_ADD(&m_noise_factor,
"noise_factor",
55 "Correct the variance if variance is close to zero or negative\n",
62 REQUIRE(noise_factor>=0,
"The noise_factor (%f) should be non negative\n", noise_factor);
63 m_noise_factor=noise_factor;
69 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n");
71 "Length of the vector of means (%d), length of the vector of "
72 "variances (%d) and number of labels (%d) should be the same\n",
77 REQUIRE(s2[i]+m_noise_factor>0.0,
78 "Corrected variational variance (original s2=%f) should always be positive after noise correction (%f)\n",
79 s2[i], m_noise_factor);
81 s2[i]+=m_noise_factor;
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
virtual void set_noise_factor(float64_t noise_factor)
CVariationalGaussianLikelihood()
virtual void set_variational_distribution(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab)
The Variational Likelihood base class.
SGVector< float64_t > m_mu
SGVector< float64_t > m_s2