SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EPInferenceMethod.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Roman Votyakov
8  *
9  * Based on ideas from GAUSSIAN PROCESS REGRESSION AND CLASSIFICATION Toolbox
10  * Copyright (C) 2005-2013 by Carl Edward Rasmussen & Hannes Nickisch under the
11  * FreeBSD License
12  * http://www.gaussianprocess.org/gpml/code/matlab/doc/
13  */
14 
15 #ifndef _EPINFERENCEMETHOD_H_
16 #define _EPINFERENCEMETHOD_H_
17 
18 #include <shogun/lib/config.h>
19 
20 #ifdef HAVE_EIGEN3
21 
23 
24 namespace shogun
25 {
26 
35 {
36 public:
39 
48  CEPInferenceMethod(CKernel* kernel, CFeatures* features, CMeanFunction* mean,
49  CLabels* labels, CLikelihoodModel* model);
50 
51  virtual ~CEPInferenceMethod();
52 
57  virtual EInferenceType get_inference_type() const { return INF_EP; }
58 
63  virtual const char* get_name() const { return "EPInferenceMethod"; }
64 
71 
84 
107  virtual SGVector<float64_t> get_alpha();
108 
124 
137 
159 
180 
185  virtual float64_t get_tolerance() const { return m_tol; }
186 
191  virtual void set_tolerance(const float64_t tol) { m_tol=tol; }
192 
197  virtual uint32_t get_min_sweep() const { return m_min_sweep; }
198 
203  virtual void set_min_sweep(const uint32_t min_sweep) { m_min_sweep=min_sweep; }
204 
209  virtual uint32_t get_max_sweep() const { return m_max_sweep; }
210 
215  virtual void set_max_sweep(const uint32_t max_sweep) { m_max_sweep=max_sweep; }
216 
221  virtual bool supports_binary() const
222  {
223  check_members();
224  return m_model->supports_binary();
225  }
226 
228  virtual void update();
229 
230 protected:
232  virtual void compute_gradient();
233 
235  virtual void update_alpha();
236 
238  virtual void update_chol();
239 
241  virtual void update_approx_cov();
242 
244  virtual void update_approx_mean();
245 
247  virtual void update_negative_ml();
248 
252  virtual void update_deriv();
253 
262  const TParameter* param);
263 
272  const TParameter* param);
273 
282  const TParameter* param);
283 
292  const TParameter* param);
293 
294 private:
295  void init();
296 
297 private:
299  SGVector<float64_t> m_mu;
300 
302  SGMatrix<float64_t> m_Sigma;
303 
305  float64_t m_nlZ;
306 
310  SGVector<float64_t> m_tnu;
311 
315  SGVector<float64_t> m_ttau;
316 
318  SGVector<float64_t> m_sttau;
319 
321  float64_t m_tol;
322 
324  uint32_t m_min_sweep;
325 
327  uint32_t m_max_sweep;
328 
330 };
331 }
332 #endif /* HAVE_EIGEN3 */
333 #endif /* _EPINFERENCEMETHOD_H_ */
virtual SGVector< float64_t > get_diagonal_vector()
virtual SGVector< float64_t > get_alpha()
virtual uint32_t get_max_sweep() const
The Inference Method base class.
virtual void set_tolerance(const float64_t tol)
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual SGMatrix< float64_t > get_posterior_covariance()
virtual EInferenceType get_inference_type() const
parameter struct
virtual float64_t get_negative_log_marginal_likelihood()
An abstract class of the mean function.
Definition: MeanFunction.h:28
virtual SGVector< float64_t > get_derivative_wrt_kernel(const TParameter *param)
virtual SGVector< float64_t > get_posterior_mean()
virtual uint32_t get_min_sweep() const
virtual float64_t get_tolerance() const
virtual SGVector< float64_t > get_derivative_wrt_mean(const TParameter *param)
double float64_t
Definition: common.h:50
virtual bool supports_binary() const
virtual void set_max_sweep(const uint32_t max_sweep)
virtual void set_min_sweep(const uint32_t min_sweep)
virtual SGVector< float64_t > get_derivative_wrt_likelihood_model(const TParameter *param)
static CEPInferenceMethod * obtain_from_generic(CInferenceMethod *inference)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual SGVector< float64_t > get_derivative_wrt_inference_method(const TParameter *param)
Class of the Expectation Propagation (EP) posterior approximation inference method.
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual void check_members() const
The Kernel base class.
Definition: Kernel.h:158
virtual SGMatrix< float64_t > get_cholesky()
virtual const char * get_name() const
virtual bool supports_binary() const
The Likelihood model base class.
CLikelihoodModel * m_model

SHOGUN Machine Learning Toolbox - Documentation