SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InferenceMethod.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  * Copyright (C) 2012 Jacob Walker
8  */
9 
10 #ifndef CINFERENCEMETHOD_H_
11 #define CINFERENCEMETHOD_H_
12 #ifdef HAVE_EIGEN3
13 #include <shogun/kernel/Kernel.h>
14 #include <shogun/base/SGObject.h>
16 #include <shogun/labels/Labels.h>
21 
22 
23 namespace shogun
24 {
25 
33 {
34 
35 public:
36 
41 
49  CInferenceMethod(CKernel* kernel, CFeatures* features,
50  CMeanFunction* mean, CLabels* labels, CLikelihoodModel* model);
51 
53  virtual ~CInferenceMethod();
54 
65 
76  CMap<TParameter*, CSGObject*>& para_dict) = 0;
77 
87  virtual SGVector<float64_t> get_alpha() = 0;
88 
99  virtual SGMatrix<float64_t> get_cholesky() = 0;
100 
112 
117  virtual void set_features(CFeatures* feat);
118 
124  {
126  return m_features;
127  }
128 
133  virtual CKernel* get_kernel() { SG_REF(m_kernel); return m_kernel; }
134 
139  virtual void set_kernel(CKernel* kern);
140 
145  virtual CMeanFunction* get_mean() { SG_REF(m_mean); return m_mean; }
146 
151  virtual void set_mean(CMeanFunction* m);
152 
157  virtual CLabels* get_labels() { SG_REF(m_labels); return m_labels; }
158 
163  virtual void set_labels(CLabels* lab);
164 
170 
175  virtual void set_model(CLikelihoodModel* mod);
176 
181  virtual void set_scale(float64_t s);
182 
187  virtual float64_t get_scale() { return m_scale; }
188 
193  virtual void set_latent_features(CFeatures* feat);
194 
200  {
202  return m_latent_features;
203  }
204 
205 
206 protected:
207 
209  virtual void update_alpha() {}
210 
212  virtual void update_chol() {}
213 
215  virtual void update_train_kernel() {}
216 
218  virtual void update_data_means();
219 
220 private:
221  void init();
222 
223 protected:
224 
227 
230 
233 
236 
239 
240 
243 
246 
249 
260 
263 
268 
271 
274 
277 
278 };
279 
280 }
281 #endif /* HAVE_EIGEN3 */
282 #endif /* CInferenceMethod_H_ */

SHOGUN Machine Learning Toolbox - Documentation