24 #ifndef __MLPACK_CORE_KERNELS_GAUSSIAN_KERNEL_HPP
25 #define __MLPACK_CORE_KERNELS_GAUSSIAN_KERNEL_HPP
59 gamma(-0.5 * pow(bandwidth, -2.0))
73 template<
typename VecType>
74 double Evaluate(
const VecType& a,
const VecType& b)
const
90 return exp(
gamma * std::pow(t, 2.0));
101 return pow(sqrt(2.0 *
M_PI) *
bandwidth, (
double) dimension);
111 template<
typename VecType>
115 (
Normalizer(a.n_rows) * pow(2.0, (
double) a.n_rows / 2.0));
127 this->
gamma = -0.5 * pow(bandwidth, -2.0);
GaussianKernel(double bandwidth)
Construct the Gaussian kernel with a custom bandwidth.
GaussianKernel()
Default constructor; sets bandwidth to 1.0.
This is a template class that can provide information about various kernels.
double Evaluate(double t) const
Evaluation of the Gaussian kernel given the distance between two points.
void Bandwidth(const double bandwidth)
Modify the bandwidth.
double gamma
Precalculated constant depending on the bandwidth; .
double ConvolutionIntegral(const VecType &a, const VecType &b)
Obtain a convolution integral of the Gaussian kernel.
static double Evaluate(const VecType1 &a, const VecType2 &b)
Computes the distance between two points.
double Bandwidth() const
Get the bandwidth.
double Evaluate(const VecType &a, const VecType &b) const
Evaluation of the Gaussian kernel.
The standard Gaussian kernel.
static const bool IsNormalized
If true, then the kernel is normalized: K(x, x) = K(y, y) = 1 for all x.
double Gamma() const
Get the precalculated constant.
double bandwidth
Kernel bandwidth.
double Normalizer(size_t dimension)
Obtain the normalization constant of the Gaussian kernel.