SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
GaussianARDKernel.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) 2015 Wu Lin
8  * Written (W) 2012 Jacob Walker
9  *
10  * Adapted from WeightedDegreeRBFKernel.h
11  */
12 
13 #ifndef GAUSSIANARDKERNEL_H
14 #define GAUSSIANARDKERNEL_H
15 
16 #include <shogun/lib/config.h>
17 
18 #include <shogun/lib/common.h>
21 
22 namespace shogun
23 {
60 {
61 public:
64 
66  virtual ~CGaussianARDKernel();
67 
73 
78  virtual const char* get_name() const { return "GaussianARDKernel"; }
79 private:
80  void init();
81 
82 protected:
94  virtual float64_t distance(int32_t idx_a, int32_t idx_b);
95 
96 #ifdef HAVE_LINALG_LIB
97 public:
103  CGaussianARDKernel(int32_t size);
104 
113  int32_t size=10);
114 
120 
127  virtual bool init(CFeatures* l, CFeatures* r);
128 
139  index_t index=-1);
140 
149  const TParameter* param, index_t index=-1);
150 
151 protected:
155  virtual void precompute_squared();
156 
163  virtual SGVector<float64_t> precompute_squared_helper(CDotFeatures* df);
164 
166  SGVector<float64_t> m_sq_lhs;
168  SGVector<float64_t> m_sq_rhs;
169 
176  virtual float64_t compute_helper(SGVector<float64_t> avec,
177  SGVector<float64_t>bvec);
178 
188  virtual float64_t compute_gradient_helper(SGVector<float64_t> avec, SGVector<float64_t> bvec,
189  float64_t scale, index_t index);
190 
191 
205  virtual float64_t get_parameter_gradient_helper(const TParameter* param,
206  index_t index, int32_t idx_a, int32_t idx_b,
208 
209 #endif /* HAVE_LINALG_LIB */
210 };
211 }
212 #endif /* _GAUSSIANARDKERNEL_H_ */
virtual EKernelType get_kernel_type()
EKernelType
Definition: Kernel.h:57
int32_t index_t
Definition: common.h:62
virtual float64_t distance(int32_t idx_a, int32_t idx_b)
parameter struct
float64_t kernel(int32_t idx_a, int32_t idx_b)
Definition: Kernel.h:207
Features that support dot products among other operations.
Definition: DotFeatures.h:44
Gaussian Kernel with Automatic Relevance Detection computed on CDotFeatures.
double float64_t
Definition: common.h:50
static CKernel * obtain_from_generic(CSGObject *kernel)
Definition: Kernel.cpp:897
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
void scale(Matrix A, Matrix B, typename Matrix::Scalar alpha)
Definition: Core.h:94
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
Definition: Kernel.h:851
virtual const char * get_name() const
The Kernel base class.
Definition: Kernel.h:159
Exponential Kernel with Automatic Relevance Detection computed on CDotFeatures.
virtual SGVector< float64_t > get_parameter_gradient_diagonal(const TParameter *param, index_t index=-1)
Definition: Kernel.h:865

SHOGUN Machine Learning Toolbox - Documentation