SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ExactInferenceMethod.h
浏览该文件的文档.
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 #ifdef HAVE_EIGEN3
38 
40 
41 namespace shogun
42 {
43 
68 {
69 public:
72 
81  CExactInferenceMethod(CKernel* kernel, CFeatures* features,
82  CMeanFunction* mean, CLabels* labels, CLikelihoodModel* model);
83 
84  virtual ~CExactInferenceMethod();
85 
90  virtual EInferenceType get_inference_type() const { return INF_EXACT; }
91 
96  virtual const char* get_name() const { return "ExactInferenceMethod"; }
97 
104 
117 
128  virtual SGVector<float64_t> get_alpha();
129 
142 
155 
166 
177 
182  virtual bool supports_regression() const
183  {
184  check_members();
185  return m_model->supports_regression();
186  }
187 
189  virtual void update();
190 
191 
192 protected:
194  virtual void check_members() const;
195 
197  virtual void update_alpha();
198 
200  virtual void update_chol();
201 
203  virtual void update_mean();
204 
206  virtual void update_cov();
207 
211  virtual void update_deriv();
212 
221  const TParameter* param);
222 
231  const TParameter* param);
232 
241  const TParameter* param);
242 
251  const TParameter* param);
252 
254  virtual void compute_gradient();
255 private:
257  SGMatrix<float64_t> m_Sigma;
258 
260  SGVector<float64_t> m_mu;
261 
263 };
264 }
265 #endif /* HAVE_EIGEN3 */
266 #endif /* CEXACTINFERENCEMETHOD_H_ */
The Gaussian exact form inference method class.
virtual bool supports_regression() const
The Inference Method base class.
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 EInferenceType get_inference_type() const
static CExactInferenceMethod * obtain_from_generic(CInferenceMethod *inference)
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
virtual SGVector< float64_t > get_diagonal_vector()
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
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:158
The Likelihood model base class.
CLikelihoodModel * m_model
virtual SGVector< float64_t > get_posterior_mean()

SHOGUN 机器学习工具包 - 项目文档