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
string
SimpleLocalityImprovedStringKernel.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
* Written (W) 1999-2008 Gunnar Raetsch
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
12
#define _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/kernel/string/StringKernel.h
>
16
17
namespace
shogun
18
{
30
class
CSimpleLocalityImprovedStringKernel
:
public
CStringKernel
<char>
31
{
32
public
:
34
CSimpleLocalityImprovedStringKernel
();
35
43
CSimpleLocalityImprovedStringKernel
(int32_t size, int32_t
length
,
44
int32_t
inner_degree
, int32_t
outer_degree
);
45
54
CSimpleLocalityImprovedStringKernel
(
55
CStringFeatures<char>
* l,
CStringFeatures<char>
* r,
56
int32_t length, int32_t inner_degree, int32_t outer_degree);
57
58
virtual
~CSimpleLocalityImprovedStringKernel
();
59
66
virtual
bool
init
(
CFeatures
*l,
CFeatures
*r);
67
69
virtual
void
cleanup
();
70
75
virtual
EKernelType
get_kernel_type
()
76
{
77
return
K_SIMPLELOCALITYIMPROVED
;
78
}
79
84
virtual
const
char
*
get_name
()
const
85
{
86
return
"SimpleLocalityImprovedStringKernel"
;
87
}
88
89
private
:
101
float64_t
dot_pyr (
const
char
*
const
x1,
const
char
*
const
x2,
102
const
int32_t NOF_NTS,
const
int32_t NTWIDTH,
103
const
int32_t DEGREE1,
const
int32_t DEGREE2,
float64_t
*pyra);
104
105
protected
:
114
float64_t
compute
(int32_t idx_a, int32_t idx_b);
115
116
private
:
117
void
init();
118
119
protected
:
121
int32_t
length
;
123
int32_t
inner_degree
;
125
int32_t
outer_degree
;
126
128
float64_t
*
pyramid_weights
;
130
int32_t
num_pyramid_weights
;
131
};
132
}
133
#endif
/* _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___ */
SHOGUN
Machine Learning Toolbox - Documentation