The Epanechnikov kernel, defined as.
More...
#include <epanechnikov_kernel.hpp>
|
| EpanechnikovKernel (const double bandwidth=1.0) |
| Instantiate the Epanechnikov kernel with the given bandwidth (default 1.0). More...
|
|
template<typename VecTypeA , typename VecTypeB > |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) const |
| Evaluate the Epanechnikov kernel on the given two inputs. More...
|
|
double | Evaluate (const double distance) const |
| Evaluate the Epanechnikov kernel given that the distance between the two input points is known. More...
|
|
double | Gradient (const double distance) const |
| Evaluate the Gradient of Epanechnikov kernel given that the distance between the two input points is known. More...
|
|
double | GradientForSquaredDistance (const double distanceSquared) const |
| Evaluate the Gradient of Epanechnikov kernel given that the squared distance between the two input points is known. More...
|
|
template<typename VecTypeA , typename VecTypeB > |
double | ConvolutionIntegral (const VecTypeA &a, const VecTypeB &b) |
| Obtains the convolution integral [integral of K(||x-a||) K(||b-x||) dx] for the two vectors. More...
|
|
double | Normalizer (const size_t dimension) |
| Compute the normalizer of this Epanechnikov kernel for the given dimension. More...
|
|
template<typename Archive > |
void | serialize (Archive &ar, const uint32_t version) |
| Serialize the kernel.
|
|
The Epanechnikov kernel, defined as.
\[ K(x, y) = \max \{0, 1 - || x - y ||^2_2 / b^2 \} \]
where \( b \) is the bandwidth the of the kernel (defaults to 1.0).
◆ EpanechnikovKernel()
mlpack::kernel::EpanechnikovKernel::EpanechnikovKernel |
( |
const double |
bandwidth = 1.0 | ) |
|
|
inline |
Instantiate the Epanechnikov kernel with the given bandwidth (default 1.0).
- Parameters
-
bandwidth | Bandwidth of the kernel. |
◆ ConvolutionIntegral()
template<typename VecTypeA , typename VecTypeB >
double mlpack::kernel::EpanechnikovKernel::ConvolutionIntegral |
( |
const VecTypeA & |
a, |
|
|
const VecTypeB & |
b |
|
) |
| |
Obtains the convolution integral [integral of K(||x-a||) K(||b-x||) dx] for the two vectors.
- Template Parameters
-
VecType | Type of vector (arma::vec, arma::spvec should be expected). |
- Parameters
-
a | First vector. |
b | Second vector. |
- Returns
- the convolution integral value.
- Template Parameters
-
VecTypeA | Type of first vector (arma::vec, arma::sp_vec should be expected). |
VecTypeB | Type of second vector (arma::vec, arma::sp_vec). |
- Parameters
-
a | First vector. |
b | Second vector. |
- Returns
- the convolution integral value.
◆ Evaluate() [1/2]
template<typename VecTypeA , typename VecTypeB >
double mlpack::kernel::EpanechnikovKernel::Evaluate |
( |
const VecTypeA & |
a, |
|
|
const VecTypeB & |
b |
|
) |
| const |
|
inline |
Evaluate the Epanechnikov kernel on the given two inputs.
- Template Parameters
-
VecTypeA | Type of first vector. |
VecTypeB | Type of second vector. |
- Parameters
-
a | One input vector. |
b | The other input vector. |
◆ Evaluate() [2/2]
double EpanechnikovKernel::Evaluate |
( |
const double |
distance | ) |
const |
Evaluate the Epanechnikov kernel given that the distance between the two input points is known.
Evaluate the kernel not for two points but for a numerical value.
◆ Gradient()
double EpanechnikovKernel::Gradient |
( |
const double |
distance | ) |
const |
Evaluate the Gradient of Epanechnikov kernel given that the distance between the two input points is known.
Evaluate gradient of the kernel not for two points but for a numerical value.
◆ GradientForSquaredDistance()
double EpanechnikovKernel::GradientForSquaredDistance |
( |
const double |
distanceSquared | ) |
const |
Evaluate the Gradient of Epanechnikov kernel given that the squared distance between the two input points is known.
Evaluate gradient of the kernel not for two points but for a numerical value.
◆ Normalizer()
double EpanechnikovKernel::Normalizer |
( |
const size_t |
dimension | ) |
|
Compute the normalizer of this Epanechnikov kernel for the given dimension.
- Parameters
-
dimension | Dimension to calculate the normalizer for. |
The documentation for this class was generated from the following files: