SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/lib/config.h>
15 
16 #include <shogun/kernel/Kernel.h>
17 #include <shogun/base/Parameter.h>
18 
19 namespace shogun
20 {
21 
24 {
25  N_REGULAR = 0,
27 };
28 
29 class CKernel;
54 {
55  public:
56 
60  {
62  m_type = N_REGULAR;
63  }
64 
66  virtual ~CKernelNormalizer() { }
67 
70  virtual bool init(CKernel* k)=0;
71 
77  virtual float64_t normalize(
78  float64_t value, int32_t idx_lhs, int32_t idx_rhs)=0;
79 
84  virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)=0;
85 
90  virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)=0;
91 
94  virtual void register_params()
95  {
96  SG_ADD((machine_int_t*) &m_type, "m_type", "Normalizer type.",
98  }
99 
103  {
104  return m_type;
105  }
106 
111  {
112  m_type = type;
113  }
114 
115  protected:
118 };
119 }
120 #endif

SHOGUN Machine Learning Toolbox - Documentation