00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2008-2009 Soeren Sonnenburg 00008 * Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _KERNELNORMALIZER_H___ 00012 #define _KERNELNORMALIZER_H___ 00013 00014 #include "kernel/Kernel.h" 00015 #include "base/Parameter.h" 00016 00017 namespace shogun 00018 { 00019 00021 enum ENormalizerType 00022 { 00023 N_REGULAR = 0, 00024 N_MULTITASK = 1 00025 }; 00026 00027 class CKernel; 00051 class CKernelNormalizer : public CSGObject 00052 { 00053 public: 00054 00057 CKernelNormalizer() : CSGObject() 00058 { 00059 m_parameters->add((machine_int_t*) &m_type, "m_type", 00060 "Normalizer type."); 00061 00062 m_type = N_REGULAR; 00063 } 00064 00066 virtual ~CKernelNormalizer() { } 00067 00070 virtual bool init(CKernel* k)=0; 00071 00077 virtual float64_t normalize( 00078 float64_t value, int32_t idx_lhs, int32_t idx_rhs)=0; 00079 00084 virtual float64_t normalize_lhs(float64_t value, int32_t idx_lhs)=0; 00085 00090 virtual float64_t normalize_rhs(float64_t value, int32_t idx_rhs)=0; 00091 00094 ENormalizerType get_normalizer_type() 00095 { 00096 return m_type; 00097 } 00098 00102 void set_normalizer_type(ENormalizerType type) 00103 { 00104 m_type = type; 00105 } 00106 00107 protected: 00109 ENormalizerType m_type; 00110 }; 00111 } 00112 #endif