|
| GaussianKernel () |
| Default constructor; sets bandwidth to 1.0.
|
|
| GaussianKernel (const double bandwidth) |
| Construct the Gaussian kernel with a custom bandwidth. More...
|
|
template<typename VecTypeA , typename VecTypeB > |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) const |
| Evaluation of the Gaussian kernel. More...
|
|
double | Evaluate (const double t) const |
| Evaluation of the Gaussian kernel given the distance between two points. More...
|
|
double | Gradient (const double t) const |
| Evaluation of the gradient of Gaussian kernel given the distance between two points. More...
|
|
double | GradientForSquaredDistance (const double t) const |
| Evaluation of the gradient of Gaussian kernel given the squared distance between two points. More...
|
|
double | Normalizer (const size_t dimension) |
| Obtain the normalization constant of the Gaussian kernel. More...
|
|
template<typename VecTypeA , typename VecTypeB > |
double | ConvolutionIntegral (const VecTypeA &a, const VecTypeB &b) |
| Obtain a convolution integral of the Gaussian kernel. More...
|
|
double | Bandwidth () const |
| Get the bandwidth.
|
|
void | Bandwidth (const double bandwidth) |
| Modify the bandwidth. More...
|
|
double | Gamma () const |
| Get the precalculated constant.
|
|
template<typename Archive > |
void | serialize (Archive &ar, const uint32_t) |
| Serialize the kernel.
|
|
The standard Gaussian kernel.
Given two vectors \( x \), \( y \), and a bandwidth \( \mu \) (set in the constructor),
\[ K(x, y) = \exp(-\frac{|| x - y ||^2}{2 \mu^2}). \]
The implementation is all in the header file because it is so simple.
template<typename VecTypeA , typename VecTypeB >
double mlpack::kernel::GaussianKernel::Evaluate |
( |
const VecTypeA & |
a, |
|
|
const VecTypeB & |
b |
|
) |
| const |
|
inline |
Evaluation of the Gaussian kernel.
This could be generalized to use any distance metric, not the Euclidean distance, but for now, the Euclidean distance is used.
- Template Parameters
-
VecType | Type of vector (likely arma::vec or arma::spvec). |
- Parameters
-
a | First vector. |
b | Second vector. |
- Returns
- K(a, b) using the bandwidth ( \(\mu\)) specified in the constructor.