Class RBFKernel¶
Defined in File RBFKernel.h
Inheritance Relationships¶
Base Type¶
public genif::Kernel(Class Kernel)
Class Documentation¶
-
class
genif::RBFKernel: public genif::Kernel¶ Public Functions
-
RBFKernel() = default¶ The default constructor for this kernel. The sigma value is 1.0.
-
RBFKernel(data_t sigma)¶ Instantiates a RBF Kernel object with given sigma.
- Parameters
sigma: Kernel sigma value.
-
RBFKernel(data_t sigma, data_t l)¶ Instantiates a RBF Kernel object with given sigma.
- Parameters
sigma: Kernel sigma value.l: A scaling value.
-
data_t
operator()(const VectorX &x1, const VectorX &x2) const override¶ Returns the RBF kernel value for two vectors x1 and x2 by using the following formula.
\(k(x_1, x_2) = _l^2 \exp(- \frac{\|x_1 - x_2 \|_2^2}{2\sigma^2})\)
The norm in the equation may be substituted by a different function by constructing this object with another distance function. However, the implementation defaults to the squared L2-norm, which effectively resembles the squared euclidean distance between the input vectors.
- Return
RBF kernel value for x1 and x2.
- Parameters
x1: A vector.x2: A vector.
-