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) 1999-2009 Soeren Sonnenburg 00008 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _SIGMOIDKERNEL_H___ 00012 #define _SIGMOIDKERNEL_H___ 00013 00014 #include "lib/common.h" 00015 #include "kernel/SimpleKernel.h" 00016 #include "features/SimpleFeatures.h" 00017 00018 namespace shogun 00019 { 00028 class CSigmoidKernel: public CSimpleKernel<float64_t> 00029 { 00030 public: 00037 CSigmoidKernel(int32_t size, float64_t gamma, float64_t coef0); 00038 00047 CSigmoidKernel(CSimpleFeatures<float64_t>* l, CSimpleFeatures<float64_t>* r, int32_t size, 00048 float64_t gamma, float64_t coef0); 00049 00050 virtual ~CSigmoidKernel(); 00051 00058 virtual bool init(CFeatures* l, CFeatures* r); 00059 00061 virtual void cleanup(); 00062 00067 virtual EKernelType get_kernel_type() { return K_SIGMOID; } 00068 00073 virtual const char* get_name() const { return "Sigmoid"; } 00074 00075 protected: 00084 virtual float64_t compute(int32_t idx_a, int32_t idx_b); 00085 00086 protected: 00088 float64_t gamma; 00090 float64_t coef0; 00091 }; 00092 } 00093 #endif /* _SIGMOIDKERNEL_H__ */