Class RBFKernel¶
Defined in File RBFKernel.h
Inheritance Relationships¶
Base Type¶
public Kernel(Class Kernel)
Class Documentation¶
-
class RBFKernel : public Kernel¶
The RBF Kernel:
\[ k(x_1, x_2) = scale \cdot \exp\left(- \frac{\|x_1 - x_2 \|_2^2}{sigma}\right) \]where \( scale > 0\) and \(sigma > 0\).Public Functions
-
RBFKernel() = default¶
The default constructor for this kernel. The sigma value is 1.0 and the scale is 1.0.
-
inline RBFKernel(data_t sigma)¶
Creates a new RBFKernel with the given sigma parameter and scale 1.0.
- Parameters
sigma – The sigma parameter > 0.
-
inline RBFKernel(data_t sigma, data_t scale)¶
Creates a new RBFKernel with the given sigma and scale parameter.
Note
This constructor uses assert to make sure that scale/sigma has the correct range. This may lead to warnings during compilation.
- Parameters
sigma – The sigma value > 0.
scale – The scale value > 0.
-
inline virtual data_t operator()(const std::vector<data_t> &x1, const std::vector<data_t> &x2) const override¶
Computes the RBF Kernel at the given points x1, x2: \(k(x_1, x_2) = scale * \exp(- \frac{\|x_1 - x_2 \|_2^2}{sigma)\) where \(scale > 0\) and \(sigma > 0\).
- Parameters
x1 – First argument for the kernel.
x2 – Second argument for the kernel
-
RBFKernel() = default¶