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 * (W) 2012 Jacob Walker 00008 * 00009 * Adapted from WeightedDegreeRBFKernel.h 00010 * 00011 */ 00012 00013 #ifndef GAUSSIANARDKERNEL_H_ 00014 #define GAUSSIANARDKERNEL_H_ 00015 00016 #include <shogun/lib/common.h> 00017 #include <shogun/kernel/DotKernel.h> 00018 #include <shogun/features/DenseFeatures.h> 00019 #include <shogun/kernel/LinearARDKernel.h> 00020 00021 namespace shogun 00022 { 00023 00027 class CGaussianARDKernel: public CLinearARDKernel 00028 { 00029 00030 public: 00034 CGaussianARDKernel(); 00035 00042 CGaussianARDKernel(int32_t size, float64_t width); 00043 00051 CGaussianARDKernel(CDenseFeatures<float64_t>* l, CDenseFeatures<float64_t>* r, 00052 int32_t size=10, float64_t width = 2.0); 00053 00055 virtual ~CGaussianARDKernel(); 00056 00063 virtual bool init(CFeatures* l, CFeatures* r); 00064 00069 virtual EKernelType get_kernel_type() { return K_GAUSSIANARD; } 00070 00075 virtual const char* get_name() const { return "GaussianARDKernel"; } 00076 00085 virtual SGMatrix<float64_t> get_parameter_gradient(TParameter* param, 00086 CSGObject* obj, index_t index = -1); 00087 00088 protected: 00089 00098 virtual float64_t compute(int32_t idx_a, int32_t idx_b); 00099 00100 private: 00101 00102 void init(); 00103 00104 protected: 00105 00107 float64_t m_width; 00108 }; 00109 00110 } /* namespace shogun */ 00111 #endif /* GAUSSIANARDKERNEL_H_ */