SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
ENormalizerType get_normalizer_type()
void set_normalizer_type(ENormalizerType type)
virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)=0
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
double float64_t
Definition: common.h:50
The class Kernel Normalizer defines a function to post-process kernel values.
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
int machine_int_t
Definition: common.h:59
The Kernel base class.
Definition: Kernel.h:158
#define SG_ADD(...)
Definition: SGObject.h:81
virtual float64_t normalize(float64_t value, int32_t idx_lhs, int32_t idx_rhs)=0
virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)=0
virtual void register_params()

SHOGUN Machine Learning Toolbox - Documentation