SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ExactInferenceMethod.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) The Shogun Machine Learning Toolbox
3  * Written (W) 2013 Roman Votyakov
4  * Written (W) 2012 Jacob Walker
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice, this
11  * list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  * this list of conditions and the following disclaimer in the documentation
14  * and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  * The views and conclusions contained in the software and documentation are those
28  * of the authors and should not be interpreted as representing official policies,
29  * either expressed or implied, of the Shogun Development Team.
30  *
31  */
32 #ifndef CEXACTINFERENCEMETHOD_H_
33 #define CEXACTINFERENCEMETHOD_H_
34 
35 #include <shogun/lib/config.h>
36 
37 
39 
40 namespace shogun
41 {
42 
67 {
68 public:
71 
80  CExactInferenceMethod(CKernel* kernel, CFeatures* features,
81  CMeanFunction* mean, CLabels* labels, CLikelihoodModel* model);
82 
83  virtual ~CExactInferenceMethod();
84 
89  virtual EInferenceType get_inference_type() const { return INF_EXACT; }
90 
95  virtual const char* get_name() const { return "ExactInferenceMethod"; }
96 
103 
116 
127  virtual SGVector<float64_t> get_alpha();
128 
141 
154 
165 
176 
181  virtual bool supports_regression() const
182  {
183  check_members();
184  return m_model->supports_regression();
185  }
186 
188  virtual void update();
189 
194  virtual void register_minimizer(Minimizer* minimizer);
195 protected:
197  virtual void check_members() const;
198 
200  virtual void update_alpha();
201 
203  virtual void update_chol();
204 
206  virtual void update_mean();
207 
209  virtual void update_cov();
210 
214  virtual void update_deriv();
215 
224  const TParameter* param);
225 
234  const TParameter* param);
235 
244  const TParameter* param);
245 
254  const TParameter* param);
255 
257  virtual void compute_gradient();
258 private:
260  SGMatrix<float64_t> m_Sigma;
261 
263  SGVector<float64_t> m_mu;
264 
266 };
267 }
268 #endif /* CEXACTINFERENCEMETHOD_H_ */
The Gaussian exact form inference method class.
virtual bool supports_regression() const
virtual SGMatrix< float64_t > get_posterior_covariance()
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
virtual const char * get_name() const
virtual SGVector< float64_t > get_alpha()
parameter struct
virtual void register_minimizer(Minimizer *minimizer)
virtual EInferenceType get_inference_type() const
An abstract class of the mean function.
Definition: MeanFunction.h:49
virtual SGMatrix< float64_t > get_cholesky()
virtual SGVector< float64_t > get_derivative_wrt_mean(const TParameter *param)
double float64_t
Definition: common.h:50
virtual SGVector< float64_t > get_derivative_wrt_inference_method(const TParameter *param)
virtual bool supports_regression() const
EInferenceType
Definition: Inference.h:53
virtual SGVector< float64_t > get_diagonal_vector()
static CExactInferenceMethod * obtain_from_generic(CInference *inference)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The Inference Method base class.
Definition: Inference.h:81
virtual float64_t get_negative_log_marginal_likelihood()
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual SGVector< float64_t > get_derivative_wrt_kernel(const TParameter *param)
virtual SGVector< float64_t > get_derivative_wrt_likelihood_model(const TParameter *param)
The Kernel base class.
Definition: Kernel.h:159
The minimizer base class.
Definition: Minimizer.h:43
CLikelihoodModel * m_model
Definition: Inference.h:475
The Likelihood model base class.
virtual SGVector< float64_t > get_posterior_mean()

SHOGUN Machine Learning Toolbox - Documentation