MeLOn
melon::kernel::KernelRBF< T, V > Class Template Reference

Implementation of Radial Basis Function kernel. More...

#include <kernel.h>

Inheritance diagram for melon::kernel::KernelRBF< T, V >:
melon::kernel::StationaryKernel< T, V > melon::kernel::Kernel< T, V >

Public Member Functions

 KernelRBF (const double gamma)
 Constructor. More...
 
RET evaluate_kernel (std::vector< T > x1, std::vector< V > x2) override
 Function for evalualting the kernel. More...
 
RET calculate_distance (std::vector< T > x1, std::vector< V > x2) override
 Function for calculating the distance used in the kernel (type of distance used can vary among kernels) More...
 
RET evaluate_kernel (RET distance) override
 Function for evalualting the kernel for a given distance. More...
 
- Public Member Functions inherited from melon::kernel::StationaryKernel< T, V >
virtual RET _quadratic_distance (std::vector< T > x1, std::vector< V > x2)
 Calculates the quadratic distance between two points x1 and x2. More...
 
- Public Member Functions inherited from melon::kernel::Kernel< T, V >
virtual ~Kernel ()=default
 Destructor. More...
 

Private Attributes

const double _gamma
 

Additional Inherited Members

- Public Types inherited from melon::kernel::Kernel< T, V >
using RET = decltype(std::declval< T >()+std::declval< V >())
 

Detailed Description

template<typename T, typename V>
class melon::kernel::KernelRBF< T, V >

Implementation of Radial Basis Function kernel.

Constructor & Destructor Documentation

◆ KernelRBF()

template<typename T , typename V >
melon::kernel::KernelRBF< T, V >::KernelRBF ( const double  gamma)
inline

Constructor.

Parameters
[in]gammais the value for the gamma parameter of the rbf kernel

Member Function Documentation

◆ calculate_distance()

template<typename T , typename V >
RET melon::kernel::KernelRBF< T, V >::calculate_distance ( std::vector< T >  x1,
std::vector< V >  x2 
)
inlineoverridevirtual

Function for calculating the distance used in the kernel (type of distance used can vary among kernels)

Parameters
[in]x1is a vector containing the first point
[in]x2is a vector containing the second point
Returns
returns the distance used in the kernel

Implements melon::kernel::StationaryKernel< T, V >.

◆ evaluate_kernel() [1/2]

template<typename T , typename V >
RET melon::kernel::KernelRBF< T, V >::evaluate_kernel ( RET  distance)
inlineoverridevirtual

Function for evalualting the kernel for a given distance.

Parameters
[in]distanceis a distance between two points for which the kernel is evaluated
Returns
returns the result of the kernel evaluation

Implements melon::kernel::StationaryKernel< T, V >.

◆ evaluate_kernel() [2/2]

template<typename T , typename V >
RET melon::kernel::KernelRBF< T, V >::evaluate_kernel ( std::vector< T >  x1,
std::vector< V >  x2 
)
inlineoverridevirtual

Function for evalualting the kernel.

Parameters
[in]x1is a vector containing the first point
[in]x2is a vector containing the second point
Returns
returns the result of the kernel evaluation

Implements melon::kernel::Kernel< T, V >.

Member Data Documentation

◆ _gamma

template<typename T , typename V >
const double melon::kernel::KernelRBF< T, V >::_gamma
private

The documentation for this class was generated from the following file: