SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExactInferenceMethod.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 CEXACTINFERENCEMETHOD_H_
11 #define CEXACTINFERENCEMETHOD_H_
12 
13 #include <shogun/lib/config.h>
15 #ifdef HAVE_EIGEN3
16 #ifdef HAVE_LAPACK
17 namespace shogun
18 {
19 
20 class CInferenceMethod;
21 
46 {
47 
48 public:
49 
52 
53  /* Constructor
54  * @param kernel covariance function
55  * @param features features to use in inference
56  * @param labels labels of the features
57  * @param model Likelihood model to use
58  */
59  CExactInferenceMethod(CKernel* kernel, CFeatures* features,
60  CMeanFunction* mean, CLabels* labels, CLikelihoodModel* model);
61 
63  virtual ~CExactInferenceMethod();
64 
75 
86 
97 
98 
110 
122 
128  inline virtual const char* get_name() const
129  {
130  return "ExactInferenceMethod";
131  }
132 
140  {
141  return get_marginal_likelihood_derivatives(para_dict);
142  }
143 
149  {
150  SGVector<float64_t> result(1);
151  result[0] = get_negative_marginal_likelihood();
152  return result;
153  }
154 
155 protected:
157  virtual void update_alpha();
158 
160  virtual void update_chol();
161 
163  virtual void update_train_kernel();
164 
166  virtual void update_all();
167 
168 private:
169 
173  void check_members();
174 
176  SGMatrix<float64_t> m_kern_with_noise;
177 };
178 
179 }
180 #endif
181 #endif // HAVE_LAPACK
182 
183 #endif /* CEXACTINFERENCEMETHOD_H_ */

SHOGUN Machine Learning Toolbox - Documentation