mlpack
master
|
The spherical kernel, which is 1 when the distance between the two argument points is less than or equal to the bandwidth, or 0 otherwise. More...
Public Member Functions | |
SphericalKernel (const double bandwidth=1.0) | |
Construct the SphericalKernel with the given bandwidth. More... | |
template<typename VecTypeA , typename VecTypeB > | |
double | ConvolutionIntegral (const VecTypeA &a, const VecTypeB &b) const |
Obtains the convolution integral [integral K(||x-a||)K(||b-x||)dx] for the two vectors. More... | |
template<typename VecTypeA , typename VecTypeB > | |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) const |
Evaluate the spherical kernel with the given two vectors. More... | |
double | Evaluate (const double t) const |
Evaluate the kernel when only a distance is given, not two points. More... | |
double | Gradient (double t) |
double | Normalizer (size_t dimension) const |
template<typename Archive > | |
void | Serialize (Archive &ar, const unsigned int) |
Serialize the object. More... | |
Private Attributes | |
double | bandwidth |
double | bandwidthSquared |
The spherical kernel, which is 1 when the distance between the two argument points is less than or equal to the bandwidth, or 0 otherwise.
Definition at line 23 of file spherical_kernel.hpp.
|
inline |
Construct the SphericalKernel with the given bandwidth.
Definition at line 29 of file spherical_kernel.hpp.
|
inline |
Obtains the convolution integral [integral K(||x-a||)K(||b-x||)dx] for the two vectors.
VecTypeA | Type of first vector (arma::vec, arma::sp_vec should be expected). |
VecTypeB | Type of second vector. |
a | First vector. |
b | Second vector. |
Definition at line 62 of file spherical_kernel.hpp.
References bandwidth, mlpack::metric::LMetric< TPower, TTakeRoot >::Evaluate(), mlpack::Log::Fatal, and Normalizer().
|
inline |
Evaluate the spherical kernel with the given two vectors.
VecTypeA | Type of first vector. |
VecTypeB | Type of second vector. |
a | First vector. |
b | Second vector. |
Definition at line 44 of file spherical_kernel.hpp.
References bandwidthSquared, and mlpack::metric::LMetric< TPower, TTakeRoot >::Evaluate().
|
inline |
Evaluate the kernel when only a distance is given, not two points.
t | Argument to kernel. |
Definition at line 99 of file spherical_kernel.hpp.
References bandwidth.
|
inline |
Definition at line 103 of file spherical_kernel.hpp.
References bandwidth.
|
inline |
Definition at line 88 of file spherical_kernel.hpp.
References bandwidth, and M_PI.
Referenced by ConvolutionIntegral().
|
inline |
Serialize the object.
Definition at line 109 of file spherical_kernel.hpp.
References bandwidth, bandwidthSquared, and mlpack::data::CreateNVP().
|
private |
Definition at line 116 of file spherical_kernel.hpp.
Referenced by ConvolutionIntegral(), Evaluate(), Gradient(), Normalizer(), and Serialize().
|
private |
Definition at line 117 of file spherical_kernel.hpp.
Referenced by Evaluate(), and Serialize().