SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
regression
gp
InferenceMethod.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 CINFERENCEMETHOD_H_
11
#define CINFERENCEMETHOD_H_
12
#ifdef HAVE_EIGEN3
13
#include <
shogun/kernel/Kernel.h
>
14
#include <
shogun/base/SGObject.h
>
15
#include <
shogun/features/DotFeatures.h
>
16
#include <
shogun/labels/Labels.h
>
17
#include <
shogun/regression/gp/LikelihoodModel.h
>
18
#include <
shogun/regression/gp/MeanFunction.h
>
19
#include <
shogun/evaluation/DifferentiableFunction.h
>
20
#include <
shogun/labels/RegressionLabels.h
>
21
22
23
namespace
shogun
24
{
25
32
class
CInferenceMethod
:
public
CDifferentiableFunction
33
{
34
35
public
:
36
40
CInferenceMethod
();
41
49
CInferenceMethod
(
CKernel
* kernel,
CFeatures
* features,
50
CMeanFunction
* mean,
CLabels
* labels,
CLikelihoodModel
* model);
51
53
virtual
~CInferenceMethod
();
54
64
virtual
float64_t
get_negative_marginal_likelihood
() = 0;
65
74
virtual
CMap<TParameter*, SGVector<float64_t>
>
75
get_marginal_likelihood_derivatives
(
76
CMap<TParameter*, CSGObject*>
& para_dict) = 0;
77
87
virtual
SGVector<float64_t>
get_alpha
() = 0;
88
99
virtual
SGMatrix<float64_t>
get_cholesky
() = 0;
100
111
virtual
SGVector<float64_t>
get_diagonal_vector
() = 0;
112
117
virtual
void
set_features
(
CFeatures
* feat);
118
123
virtual
CFeatures
*
get_features
()
124
{
125
SG_REF
(
m_features
);
126
return
m_features
;
127
}
128
133
virtual
CKernel
*
get_kernel
() {
SG_REF
(
m_kernel
);
return
m_kernel
; }
134
139
virtual
void
set_kernel
(
CKernel
* kern);
140
145
virtual
CMeanFunction
*
get_mean
() {
SG_REF
(
m_mean
);
return
m_mean
; }
146
151
virtual
void
set_mean
(
CMeanFunction
* m);
152
157
virtual
CLabels
*
get_labels
() {
SG_REF
(
m_labels
);
return
m_labels
; }
158
163
virtual
void
set_labels
(
CLabels
* lab);
164
169
CLikelihoodModel
*
get_model
() {
SG_REF
(
m_model
);
return
m_model
; }
170
175
virtual
void
set_model
(
CLikelihoodModel
* mod);
176
181
virtual
void
set_scale
(
float64_t
s);
182
187
virtual
float64_t
get_scale
() {
return
m_scale
; }
188
193
virtual
void
set_latent_features
(
CFeatures
* feat);
194
199
virtual
CFeatures
*
get_latent_features
()
200
{
201
SG_REF
(
m_latent_features
);
202
return
m_latent_features
;
203
}
204
205
206
protected
:
207
209
virtual
void
update_alpha
() {}
210
212
virtual
void
update_chol
() {}
213
215
virtual
void
update_train_kernel
() {}
216
218
virtual
void
update_data_means
();
219
220
private
:
221
void
init();
222
223
protected
:
224
226
CKernel
*
m_kernel
;
227
229
CFeatures
*
m_features
;
230
232
SGMatrix<float64_t>
m_feature_matrix
;
233
235
SGVector<float64_t>
m_data_means
;
236
238
SGVector<float64_t>
m_label_vector
;
239
240
242
CLabels
*
m_labels
;
243
245
CMeanFunction
*
m_mean
;
246
248
CFeatures
*
m_latent_features
;
249
259
CLikelihoodModel
*
m_model
;
260
262
SGVector< float64_t >
m_alpha
;
263
267
SGMatrix<float64_t>
m_L
;
268
270
float64_t
m_scale
;
271
273
SGMatrix<float64_t>
m_ktrtr
;
274
276
SGMatrix<float64_t>
m_latent_matrix
;
277
278
};
279
280
}
281
#endif
/* HAVE_EIGEN3 */
282
#endif
/* CInferenceMethod_H_ */
SHOGUN
Machine Learning Toolbox - Documentation