12 #ifndef MLPACK_CORE_KERNELS_LAPLACIAN_KERNEL_HPP 13 #define MLPACK_CORE_KERNELS_LAPLACIAN_KERNEL_HPP 60 template<
typename VecTypeA,
typename VecTypeB>
61 double Evaluate(
const VecTypeA& a,
const VecTypeB& b)
const 78 return exp(-t / bandwidth);
91 return exp(-t / bandwidth) / -bandwidth;
100 template<
typename Archive>
103 ar(CEREAL_NVP(bandwidth));
117 static const bool IsNormalized =
true;
119 static const bool UsesSquaredDistance =
false;
This is a template class that can provide information about various kernels.
Definition: kernel_traits.hpp:27
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
static VecTypeA::elem_type Evaluate(const VecTypeA &a, const VecTypeB &b)
Computes the distance between two points.
Definition: lmetric_impl.hpp:24
LaplacianKernel()
Default constructor; sets bandwidth to 1.0.
Definition: laplacian_kernel.hpp:36
double & Bandwidth()
Modify the bandwidth.
Definition: laplacian_kernel.hpp:97
double Evaluate(const VecTypeA &a, const VecTypeB &b) const
Evaluation of the Laplacian kernel.
Definition: laplacian_kernel.hpp:61
double Evaluate(const double t) const
Evaluation of the Laplacian kernel given the distance between two points.
Definition: laplacian_kernel.hpp:75
double Bandwidth() const
Get the bandwidth.
Definition: laplacian_kernel.hpp:95
void serialize(Archive &ar, const uint32_t)
Serialize the kernel.
Definition: laplacian_kernel.hpp:101
The standard Laplacian kernel.
Definition: laplacian_kernel.hpp:30
LaplacianKernel(double bandwidth)
Construct the Laplacian kernel with a custom bandwidth.
Definition: laplacian_kernel.hpp:44
double Gradient(const double t) const
Evaluation of the gradient of the Laplacian kernel given the distance between two points...
Definition: laplacian_kernel.hpp:90