MLpp
ml::Kernels::DifferentiableRBFKernel< DiffRBF > Class Template Reference

Differentiable radial basis function kernel. More...

#include <Kernels.hpp>

Inheritance diagram for ml::Kernels::DifferentiableRBFKernel< DiffRBF >:
Collaboration diagram for ml::Kernels::DifferentiableRBFKernel< DiffRBF >:

Public Member Functions

void gradient (const Eigen::Ref< const Eigen::VectorXd > x1, const Eigen::Ref< const Eigen::VectorXd > x2, Eigen::Ref< Eigen::VectorXd > dydx1) const override
 Gradient of the kernel \( K(\vec{x}_1, \vec{x}_2) \) over the first feature vector. The gradient over the second vector can be calculated by swapping them, due to the symmetry of the kernel function. More...
 
- Public Member Functions inherited from ml::Kernels::Kernel
virtual ~Kernel ()
 Virtual destructor.
 
virtual unsigned int dim () const =0
 Dimension of the feature space.
 
- Public Member Functions inherited from ml::Kernels::RBFKernel< DifferentiableRadialBasisFunction >
 RBFKernel (std::unique_ptr< const DifferentiableRadialBasisFunction > &&rbf, unsigned int dim)
 Constructor. More...
 
 RBFKernel (const RBFKernel &other)=delete
 
 RBFKernel (RBFKernel &&other)=default
 
RBFKerneloperator= (const RBFKernel &other)=delete
 
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.
 

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
 
- Protected Attributes inherited from ml::Kernels::RBFKernel< DifferentiableRadialBasisFunction >
std::unique_ptr< const DifferentiableRadialBasisFunctionrbf_
 

Detailed Description

template<class DiffRBF = DifferentiableRadialBasisFunction>
class ml::Kernels::DifferentiableRBFKernel< DiffRBF >

Differentiable radial basis function kernel.

Template Parameters
DiffRBFDifferentiableRadialBasisFunction or its child class.

Member Function Documentation

◆ gradient()

template<class DiffRBF = DifferentiableRadialBasisFunction>
void ml::Kernels::DifferentiableRBFKernel< DiffRBF >::gradient ( const Eigen::Ref< const Eigen::VectorXd >  x1,
const Eigen::Ref< const Eigen::VectorXd >  x2,
Eigen::Ref< Eigen::VectorXd >  dydx1 
) const
inlineoverridevirtual

Gradient of the kernel \( K(\vec{x}_1, \vec{x}_2) \) over the first feature vector. The gradient over the second vector can be calculated by swapping them, due to the symmetry of the kernel function.

Parameters
[in]x1First feature vector.
[in]x2Second feature vector.
[out]Gradientover x1. Must have the same size as x1 and x2.
Exceptions
std::invalid_argumentIf x1.size() != #dim(), x2.size() != #dim() or dydx1.size() != #dim().

Implements ml::Kernels::DifferentiableKernel.


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