MLpp
ml::Kernels::RBFKernel< RBF > Class Template Reference

Radial basis function kernel. More...

#include <Kernels.hpp>

Inheritance diagram for ml::Kernels::RBFKernel< RBF >:
Collaboration diagram for ml::Kernels::RBFKernel< RBF >:

Public Member Functions

 RBFKernel (std::unique_ptr< const RBF > &&rbf, unsigned int dim)
 Constructor. More...
 
 RBFKernel (const RBFKernel &other)=delete
 
RBFKerneloperator= (const RBFKernel &other)=delete
 
 RBFKernel (RBFKernel &&other)=default
 
RBFKerneloperator= (RBFKernel &&other)=default
 
double value (const Eigen::Ref< const Eigen::VectorXd > x1, const Eigen::Ref< const Eigen::VectorXd > x2) const override
 Value of the kernel \( K(\vec{x}_1, \vec{x}_2) \). More...
 
unsigned int dim () const override
 Dimension of the feature space.
 
- Public Member Functions inherited from ml::Kernels::Kernel
virtual ~Kernel ()
 Virtual destructor.
 

Protected Attributes

std::unique_ptr< const RBF > rbf_
 

Additional Inherited Members

- Protected Member Functions inherited from ml::Kernels::Kernel
void validate_arguments (const Eigen::Ref< const Eigen::VectorXd > x1, const Eigen::Ref< const Eigen::VectorXd > x2) const
 

Detailed Description

template<class RBF = RadialBasisFunction>
class ml::Kernels::RBFKernel< RBF >

Radial basis function kernel.

Kernel function of the form K(x1, x2) = s(||x1 - x2||^2).

See https://en.wikipedia.org/wiki/Radial_basis_function_kernel

Template Parameters
RBFRadialBasisFunction or its child class.

Constructor & Destructor Documentation

◆ RBFKernel()

template<class RBF = RadialBasisFunction>
ml::Kernels::RBFKernel< RBF >::RBFKernel ( std::unique_ptr< const RBF > &&  rbf,
unsigned int  dim 
)
inline

Constructor.

Parameters
rbfRadial basis function, moved.
dimDimension of the kernel, positive.
Exceptions
std::invalid_argumentIf rbf is null.
std::domain_errorIf dim is zero.

Member Function Documentation

◆ value()

template<class RBF = RadialBasisFunction>
double ml::Kernels::RBFKernel< RBF >::value ( const Eigen::Ref< const Eigen::VectorXd >  x1,
const Eigen::Ref< const Eigen::VectorXd >  x2 
) const
inlineoverridevirtual

Value of the kernel \( K(\vec{x}_1, \vec{x}_2) \).

Parameters
[in]x1First feature vector.
[in]x2Second feature vector.
Returns
Kernel value.
Exceptions
std::invalid_argumentIf x1.size() != #dim() or x2.size() != #dim().

Implements ml::Kernels::Kernel.


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