SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FITCInferenceMethod.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  * Copyright (C) 2012 Jacob Walker
9  * Copyright (C) 2013 Roman Votyakov
10  *
11  * Code adapted from Gaussian Process Machine Learning Toolbox
12  * http://www.gaussianprocess.org/gpml/code/matlab/doc/
13  */
14 
15 #ifndef CFITCINFERENCEMETHOD_H_
16 #define CFITCINFERENCEMETHOD_H_
17 
18 #include <shogun/lib/config.h>
19 
20 #ifdef HAVE_EIGEN3
21 
23 
24 namespace shogun
25 {
26 
41 {
42 public:
45 
55  CFITCInferenceMethod(CKernel* kernel, CFeatures* features,
56  CMeanFunction* mean, CLabels* labels, CLikelihoodModel* model,
57  CFeatures* latent_features);
58 
59  virtual ~CFITCInferenceMethod();
60 
65  virtual EInferenceType get_inference_type() const { return INF_FITC; }
66 
71  virtual const char* get_name() const { return "FITCInferenceMethod"; }
72 
79 
84  virtual void set_latent_features(CFeatures* feat)
85  {
86  SG_REF(feat);
87  SG_UNREF(m_latent_features);
88  m_latent_features=feat;
89  }
90 
96  {
97  SG_REF(m_latent_features);
98  return m_latent_features;
99  }
100 
113 
124  virtual SGVector<float64_t> get_alpha();
125 
138 
151 
168 
185 
190  virtual bool supports_regression() const
191  {
192  check_members();
193  return m_model->supports_regression();
194  }
195 
197  virtual void update();
198 
199 protected:
201  virtual void check_members() const;
202 
204  virtual void update_alpha();
205 
207  virtual void update_chol();
208 
210  virtual void update_train_kernel();
211 
215  virtual void update_deriv();
216 
225  const TParameter* param);
226 
235  const TParameter* param);
236 
245  const TParameter* param);
246 
255  const TParameter* param);
256 
257 private:
258  void init();
259 
260 private:
262  CFeatures* m_latent_features;
263 
265  float64_t m_ind_noise;
266 
268  SGMatrix<float64_t> m_chol_uu;
269 
271  SGMatrix<float64_t> m_chol_utr;
272 
274  SGMatrix<float64_t> m_kuu;
275 
277  SGMatrix<float64_t> m_ktru;
278 
282  SGVector<float64_t> m_dg;
283 
286 
288  SGVector<float64_t> m_be;
289 
290  SGVector<float64_t> m_al;
291 
293 
295 
297 };
298 }
299 #endif /* HAVE_EIGEN3 */
300 #endif /* CFITCINFERENCEMETHOD_H_ */

SHOGUN Machine Learning Toolbox - Documentation