SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 update_alpha();
233 
235  virtual void update_chol();
236 
238  virtual void update_approx_cov();
239 
241  virtual void update_approx_mean();
242 
244  virtual void update_negative_ml();
245 
249  virtual void update_deriv();
250 
259  const TParameter* param);
260 
269  const TParameter* param);
270 
279  const TParameter* param);
280 
289  const TParameter* param);
290 
291 private:
292  void init();
293 
294 private:
296  SGVector<float64_t> m_mu;
297 
299  SGMatrix<float64_t> m_Sigma;
300 
302  float64_t m_nlZ;
303 
307  SGVector<float64_t> m_tnu;
308 
312  SGVector<float64_t> m_ttau;
313 
315  SGVector<float64_t> m_sttau;
316 
318  float64_t m_tol;
319 
321  uint32_t m_min_sweep;
322 
324  uint32_t m_max_sweep;
325 
327 };
328 }
329 #endif /* HAVE_EIGEN3 */
330 #endif /* _EPINFERENCEMETHOD_H_ */

SHOGUN Machine Learning Toolbox - Documentation