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
normalizer
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
SG_ADD
((
machine_int_t
*) &
m_type
,
"m_type"
,
"Normalizer type."
,
95
MS_NOT_AVAILABLE
);
96
}
97
100
ENormalizerType
get_normalizer_type
()
101
{
102
return
m_type
;
103
}
104
108
void
set_normalizer_type
(
ENormalizerType
type)
109
{
110
m_type
= type;
111
}
112
113
protected
:
115
ENormalizerType
m_type
;
116
};
117
}
118
#endif
SHOGUN
Machine Learning Toolbox - Documentation