SHOGUN  v3.2.0
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_ */
virtual SGVector< float64_t > get_derivative_wrt_inference_method(const TParameter *param)
virtual void check_members() const
virtual CFeatures * get_latent_features()
virtual const char * get_name() const
The Inference Method base class.
virtual SGVector< float64_t > get_diagonal_vector()
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
#define SG_UNREF(x)
Definition: SGRefObject.h:35
parameter struct
Definition: Parameter.h:26
virtual SGMatrix< float64_t > get_cholesky()
virtual bool supports_regression() const
virtual SGVector< float64_t > get_posterior_mean()
An abstract class of the mean function.
Definition: MeanFunction.h:26
virtual float64_t get_negative_log_marginal_likelihood()
virtual SGVector< float64_t > get_derivative_wrt_kernel(const TParameter *param)
double float64_t
Definition: common.h:48
#define SG_REF(x)
Definition: SGRefObject.h:34
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
virtual EInferenceType get_inference_type() const
The class Features is the base class of all feature objects.
Definition: Features.h:62
The Fully Independent Conditional Training inference method class.
virtual SGVector< float64_t > get_derivative_wrt_likelihood_model(const TParameter *param)
virtual void set_latent_features(CFeatures *feat)
virtual bool supports_regression() const
The Kernel base class.
Definition: Kernel.h:150
virtual SGVector< float64_t > get_derivative_wrt_mean(const TParameter *param)
virtual SGVector< float64_t > get_alpha()
The Likelihood model base class.
CLikelihoodModel * m_model
virtual SGMatrix< float64_t > get_posterior_covariance()
static CFITCInferenceMethod * obtain_from_generic(CInferenceMethod *inference)

SHOGUN Machine Learning Toolbox - Documentation