SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
machine
gp
LaplacianInferenceMethod.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 CLAPLACIANINFERENCEMETHOD_H_
16
#define CLAPLACIANINFERENCEMETHOD_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
42
class
CLaplacianInferenceMethod
:
public
CInferenceMethod
43
{
44
public
:
46
CLaplacianInferenceMethod
();
47
56
CLaplacianInferenceMethod
(
CKernel
* kernel,
CFeatures
* features,
57
CMeanFunction
* mean,
CLabels
* labels,
CLikelihoodModel
* model);
58
59
virtual
~CLaplacianInferenceMethod
();
60
65
virtual
EInferenceType
get_inference_type
()
const
{
return
INF_LAPLACIAN
; }
66
71
virtual
const
char
*
get_name
()
const
{
return
"LaplacianInferenceMethod"
; }
72
84
virtual
float64_t
get_negative_log_marginal_likelihood
();
85
96
virtual
SGVector<float64_t>
get_alpha
();
97
109
virtual
SGMatrix<float64_t>
get_cholesky
();
110
122
virtual
SGVector<float64_t>
get_diagonal_vector
();
123
136
virtual
SGVector<float64_t>
get_posterior_mean
();
137
156
virtual
SGMatrix<float64_t>
get_posterior_covariance
();
157
162
virtual
float64_t
get_newton_tolerance
() {
return
m_tolerance; }
163
168
virtual
void
set_newton_tolerance
(
float64_t
tol) { m_tolerance=tol; }
169
174
virtual
int32_t
get_newton_iterations
() {
return
m_iter; }
175
180
virtual
void
set_newton_iterations
(int32_t iter) { m_iter=iter; }
181
186
virtual
float64_t
get_minimization_tolerance
() {
return
m_opt_tolerance; }
187
192
virtual
void
set_minimization_tolerance
(
float64_t
tol) { m_opt_tolerance=tol; }
193
198
virtual
float64_t
get_minimization_max
() {
return
m_opt_max; }
199
204
virtual
void
set_minimization_max
(
float64_t
max) { m_opt_max=max; }
205
210
virtual
bool
supports_regression
()
const
211
{
212
check_members
();
213
return
m_model
->
supports_regression
();
214
}
215
220
virtual
bool
supports_binary
()
const
221
{
222
check_members
();
223
return
m_model
->
supports_binary
();
224
}
225
227
virtual
void
update
();
228
229
protected
:
231
virtual
void
update_alpha
();
232
234
virtual
void
update_chol
();
235
237
virtual
void
update_approx_cov
();
238
242
virtual
void
update_deriv
();
243
251
virtual
SGVector<float64_t>
get_derivative_wrt_inference_method
(
252
const
TParameter
* param);
253
261
virtual
SGVector<float64_t>
get_derivative_wrt_likelihood_model
(
262
const
TParameter
* param);
263
271
virtual
SGVector<float64_t>
get_derivative_wrt_kernel
(
272
const
TParameter
* param);
273
281
virtual
SGVector<float64_t>
get_derivative_wrt_mean
(
282
const
TParameter
* param);
283
284
private
:
285
void
init();
286
287
private
:
289
float64_t
m_tolerance;
290
292
index_t
m_iter;
293
295
float64_t
m_opt_tolerance;
296
298
float64_t
m_opt_max;
299
301
SGVector<float64_t>
m_mu;
302
304
SGMatrix<float64_t>
m_Sigma;
305
307
SGVector<float64_t>
W;
308
310
SGVector<float64_t>
sW;
311
313
SGVector<float64_t>
dlp;
314
316
SGVector<float64_t>
d2lp;
317
319
SGVector<float64_t>
d3lp;
320
321
SGVector<float64_t>
m_dfhat;
322
323
SGMatrix<float64_t>
m_Z;
324
325
SGVector<float64_t>
m_g;
326
};
327
}
328
#endif
/* HAVE_EIGEN3 */
329
#endif
/* CLAPLACIANINFERENCEMETHOD_H_ */
SHOGUN
机器学习工具包 - 项目文档