SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
machine
gp
FITCInferenceMethod.h
浏览该文件的文档.
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
22
#include <
shogun/machine/gp/InferenceMethod.h
>
23
24
namespace
shogun
25
{
26
40
class
CFITCInferenceMethod
:
public
CInferenceMethod
41
{
42
public
:
44
CFITCInferenceMethod
();
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
78
static
CFITCInferenceMethod
*
obtain_from_generic
(
CInferenceMethod
* inference);
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
95
virtual
CFeatures
*
get_latent_features
()
96
{
97
SG_REF
(m_latent_features);
98
return
m_latent_features;
99
}
100
112
virtual
float64_t
get_negative_log_marginal_likelihood
();
113
124
virtual
SGVector<float64_t>
get_alpha
();
125
137
virtual
SGMatrix<float64_t>
get_cholesky
();
138
150
virtual
SGVector<float64_t>
get_diagonal_vector
();
151
167
virtual
SGVector<float64_t>
get_posterior_mean
();
168
184
virtual
SGMatrix<float64_t>
get_posterior_covariance
();
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
224
virtual
SGVector<float64_t>
get_derivative_wrt_inference_method
(
225
const
TParameter
* param);
226
234
virtual
SGVector<float64_t>
get_derivative_wrt_likelihood_model
(
235
const
TParameter
* param);
236
244
virtual
SGVector<float64_t>
get_derivative_wrt_kernel
(
245
const
TParameter
* param);
246
254
virtual
SGVector<float64_t>
get_derivative_wrt_mean
(
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
285
SGVector<float64_t>
m_r;
286
288
SGVector<float64_t>
m_be;
289
290
SGVector<float64_t>
m_al;
291
292
SGMatrix<float64_t>
m_B;
293
294
SGVector<float64_t>
m_w;
295
296
SGMatrix<float64_t>
m_W;
297
};
298
}
299
#endif
/* HAVE_EIGEN3 */
300
#endif
/* CFITCINFERENCEMETHOD_H_ */
SHOGUN
机器学习工具包 - 项目文档