SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
kernel
LinearARDKernel.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
* (W) 2012 Jacob Walker
8
*
9
* Adapted from WeightedDegreeRBFKernel.h
10
*/
11
12
#ifndef LINEARARDKERNEL_H_
13
#define LINEARARDKERNEL_H_
14
15
#include <
shogun/lib/common.h
>
16
#include <
shogun/kernel/DotKernel.h
>
17
#include <
shogun/features/DenseFeatures.h
>
18
19
namespace
shogun
20
{
21
23
class
CLinearARDKernel
:
public
CDotKernel
24
{
25
public
:
27
CLinearARDKernel
();
28
33
CLinearARDKernel
(int32_t size);
34
41
CLinearARDKernel
(
CDenseFeatures<float64_t>
* l,
CDenseFeatures<float64_t>
* r,
42
int32_t size=10);
43
44
virtual
~CLinearARDKernel
();
45
52
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
53
58
virtual
EKernelType
get_kernel_type
() {
return
K_LINEARARD
; }
59
64
virtual
const
char
*
get_name
()
const
{
return
"LinearARDKernel"
; }
65
70
virtual
EFeatureClass
get_feature_class
() {
return
C_DENSE
; }
71
76
virtual
EFeatureType
get_feature_type
() {
return
F_DREAL
; }
77
83
virtual
void
set_weight
(
float64_t
w,
index_t
i);
84
91
virtual
float64_t
get_weight
(
index_t
i);
92
94
virtual
SGVector<float64_t>
get_weights
() {
return
m_weights
; }
95
100
virtual
void
set_weights
(
SGVector<float64_t>
weights) {
m_weights
=weights; }
101
102
protected
:
111
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
112
117
void
init_ft_weights
();
118
126
virtual
SGMatrix<float64_t>
get_parameter_gradient
(
const
TParameter
* param,
127
index_t
index=-1);
128
129
private
:
130
void
init();
131
132
protected
:
134
SGVector<float64_t>
m_weights
;
135
};
136
}
137
#endif
/* LINEARARDKERNEL_H_ */
SHOGUN
机器学习工具包 - 项目文档