39 using namespace Eigen;
44 CDualVariationalGaussianLikelihood::CDualVariationalGaussianLikelihood()
59 "The likelihood model (%s) does NOT support variational guassian inference\n",
104 REQUIRE((strict_scale>0 && strict_scale<1),
105 "The strict_scale (%f) should be between 0 and 1 exclusively.\n",
113 "The length (%d) of direction should be same as the length (%d) of dual parameters\n",
117 "The step size (%f) should be non-negative\n", step);
122 ASSERT(upper_bound>=lower_bound);
131 if (direction[i]==0.0)
158 REQUIRE(lab,
"Labels are required (lab should not be NULL)\n");
161 "Length of the vector of lambda (%d) "
162 "and number of labels (%d) should be the same\n",
165 "Labels (%s) must be type of CBinaryLabels\n",
173 for(
index_t i = 0; i < m_lab.size(); ++i)
189 if (value<lower_bound)
197 if (value>upper_bound)
217 void CDualVariationalGaussianLikelihood::init()
220 "Dual parameter for variational s2",
224 "Is the Dual parameter valid",
228 "The strict variable used in adjust_step_wrt_dual_parameter",
virtual const char * get_name() const =0
virtual SGVector< float64_t > get_first_derivative_wrt_hyperparameter(const TParameter *param) const
virtual bool set_variational_distribution(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab)
CLikelihoodModel * m_likelihood
virtual ELabelType get_label_type() const =0
virtual SGVector< float64_t > get_first_derivative_wrt_hyperparameter(const TParameter *param) const =0
virtual SGVector< float64_t > get_variational_first_derivative(const TParameter *param) const =0
virtual void set_dual_parameters(SGVector< float64_t > the_lambda, const CLabels *lab)
virtual ~CDualVariationalGaussianLikelihood()
The class Labels models labels, i.e. class assignments of objects.
static const float64_t INFTY
infinity
virtual CSGObject * clone()
virtual void precompute()
virtual int32_t get_num_labels() const =0
virtual bool dual_lower_bound_strict() const =0
The variational Gaussian Likelihood base class. The variational distribution is Gaussian.
virtual bool dual_parameters_valid() const
virtual void set_noise_factor(float64_t noise_factor)
virtual float64_t get_dual_upper_bound() const =0
virtual float64_t adjust_step_wrt_dual_parameter(SGVector< float64_t > direction, const float64_t step) const
SGVector< float64_t > m_lab
virtual bool set_variational_distribution(SGVector< float64_t > mu, SGVector< float64_t > s2, const CLabels *lab)
virtual bool supports_derivative_wrt_hyperparameter() const
virtual void set_strict_scale(float64_t strict_scale)
virtual SGVector< float64_t > get_variational_expection()=0
virtual void set_noise_factor(float64_t noise_factor)
virtual SGVector< float64_t > get_variational_expection()
virtual CVariationalGaussianLikelihood * get_variational_likelihood() const
virtual float64_t get_dual_lower_bound() const =0
all of classes and functions are contained in the shogun namespace
The Variational Likelihood base class.
SGVector< float64_t > m_lambda
Binary Labels for binary classification.
virtual bool dual_upper_bound_strict() const =0
virtual bool supports_derivative_wrt_hyperparameter() const =0
virtual SGVector< float64_t > get_variational_first_derivative(const TParameter *param) const