The trivially simple triangular kernel, defined by.
More...
#include <triangular_kernel.hpp>
|
| | TriangularKernel (const double bandwidth=1.0) |
| | Initialize the triangular 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 triangular kernel for the two given vectors. More...
|
| |
| double | Evaluate (const double distance) const |
| | Evaluate the triangular kernel given that the distance between the two points is known. More...
|
| |
| double | Gradient (const double distance) const |
| | Evaluate the gradient of triangular kernel given that the distance between the two points is known. More...
|
| |
|
double | Bandwidth () const |
| | Get the bandwidth of the kernel.
|
| |
|
double & | Bandwidth () |
| | Modify the bandwidth of the kernel.
|
| |
|
template<typename Archive > |
| void | serialize (Archive &ar, const uint32_t) |
| | Serialize the kernel.
|
| |
The trivially simple triangular kernel, defined by.
\[ K(x, y) = \max \{ 0, 1 - \frac{|| x - y ||_2}{b} \} \]
where \( b \) is the bandwidth of the kernel.
◆ TriangularKernel()
| mlpack::kernel::TriangularKernel::TriangularKernel |
( |
const double |
bandwidth = 1.0 | ) |
|
|
inline |
Initialize the triangular kernel with the given bandwidth (default 1.0).
- Parameters
-
| bandwidth | Bandwidth of the triangular kernel. |
◆ Evaluate() [1/2]
template<typename VecTypeA , typename VecTypeB >
| double mlpack::kernel::TriangularKernel::Evaluate |
( |
const VecTypeA & |
a, |
|
|
const VecTypeB & |
b |
|
) |
| const |
|
inline |
Evaluate the triangular kernel for the two given vectors.
- Template Parameters
-
| VecTypeA | Type of first vector. |
| VecTypeB | Type of second vector. |
- Parameters
-
| a | First vector. |
| b | Second vector. |
◆ Evaluate() [2/2]
| double mlpack::kernel::TriangularKernel::Evaluate |
( |
const double |
distance | ) |
const |
|
inline |
Evaluate the triangular kernel given that the distance between the two points is known.
- Parameters
-
| distance | The distance between the two points. |
◆ Gradient()
| double mlpack::kernel::TriangularKernel::Gradient |
( |
const double |
distance | ) |
const |
|
inline |
Evaluate the gradient of triangular kernel given that the distance between the two points is known.
- Parameters
-
| distance | The distance between the two points. |
The documentation for this class was generated from the following file: