SHOGUN
v1.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
shogun
kernel
KernelNormalizer.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) 2008-2009 Soeren Sonnenburg
8
* Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _KERNELNORMALIZER_H___
12
#define _KERNELNORMALIZER_H___
13
14
#include <
shogun/kernel/Kernel.h
>
15
#include <
shogun/base/Parameter.h
>
16
17
namespace
shogun
18
{
19
21
enum
ENormalizerType
22
{
23
N_REGULAR
= 0,
24
N_MULTITASK
= 1
25
};
26
27
class
CKernel;
51
class
CKernelNormalizer
:
public
CSGObject
52
{
53
public
:
54
57
CKernelNormalizer
() :
CSGObject
()
58
{
59
register_params
();
60
m_type
=
N_REGULAR
;
61
}
62
64
virtual
~CKernelNormalizer
() { }
65
68
virtual
bool
init(
CKernel
* k)=0;
69
75
virtual
float64_t
normalize
(
76
float64_t
value, int32_t idx_lhs, int32_t idx_rhs)=0;
77
82
virtual
float64_t
normalize_lhs
(
float64_t
value, int32_t idx_lhs)=0;
83
88
virtual
float64_t
normalize_rhs
(
float64_t
value, int32_t idx_rhs)=0;
89
92
virtual
void
register_params
()
93
{
94
m_parameters
->
add
((
machine_int_t
*) &
m_type
,
"m_type"
,
"Normalizer type."
);
95
}
96
99
ENormalizerType
get_normalizer_type
()
100
{
101
return
m_type
;
102
}
103
107
void
set_normalizer_type
(
ENormalizerType
type)
108
{
109
m_type
= type;
110
}
111
112
protected
:
114
ENormalizerType
m_type
;
115
};
116
}
117
#endif
SHOGUN
Machine Learning Toolbox - Documentation