SHOGUN  v3.0.0
 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/kernel/Kernel.h>
15 #include <shogun/base/Parameter.h>
16 
17 namespace shogun
18 {
19 
22 {
23  N_REGULAR = 0,
25 };
26 
27 class CKernel;
52 {
53  public:
54 
58  {
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.",
96  }
97 
101  {
102  return m_type;
103  }
104 
109  {
110  m_type = type;
111  }
112 
113  protected:
116 };
117 }
118 #endif

SHOGUN Machine Learning Toolbox - Documentation