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
kernel
LinearARDKernel.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
* (W) 2012 Jacob Walker
8
*
9
* Adapted from WeightedDegreeRBFKernel.h
10
*
11
*/
12
13
#ifndef LINEARARDKERNEL_H_
14
#define LINEARARDKERNEL_H_
15
16
#include <
shogun/lib/common.h
>
17
#include <
shogun/kernel/DotKernel.h
>
18
#include <
shogun/features/DenseFeatures.h
>
19
20
namespace
shogun
21
{
22
26
class
CLinearARDKernel
:
public
CDotKernel
27
{
28
29
public
:
33
CLinearARDKernel
();
34
39
CLinearARDKernel
(int32_t size);
40
47
CLinearARDKernel
(
CDenseFeatures<float64_t>
* l,
CDenseFeatures<float64_t>
* r,
48
int32_t size=10);
49
50
virtual
~CLinearARDKernel
();
51
58
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
59
64
virtual
EKernelType
get_kernel_type
() {
return
K_LINEARARD
; }
65
70
inline
virtual
const
char
*
get_name
()
const
{
return
"LinearARDKernel"
; }
71
72
77
inline
virtual
EFeatureClass
get_feature_class
() {
return
C_DENSE
; }
78
83
virtual
EFeatureType
get_feature_type
() {
return
F_DREAL
; }
84
90
virtual
void
set_weight
(
float64_t
w,
index_t
i);
91
98
virtual
float64_t
get_weight
(
index_t
i);
99
100
protected
:
101
110
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
111
116
void
init_ft_weights
();
117
126
virtual
SGMatrix<float64_t>
get_parameter_gradient
(
TParameter
* param,
127
CSGObject
* obj,
index_t
index);
128
129
private
:
130
131
void
init();
132
133
protected
:
134
136
SGVector<float64_t>
m_weights
;
137
};
138
139
}
/* namespace shogun */
140
#endif
/* LINEARARDKERNEL_H_ */
SHOGUN
Machine Learning Toolbox - Documentation