mlpack
master
|
The trivially simple triangular kernel, defined by. More...
Public Member Functions | |
TriangularKernel (const double bandwidth=1.0) | |
Initialize the triangular kernel with the given bandwidth (default 1.0). More... | |
double | Bandwidth () const |
Get the bandwidth of the kernel. More... | |
double & | Bandwidth () |
Modify the bandwidth of the kernel. 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... | |
template<typename Archive > | |
void | Serialize (Archive &ar, const unsigned int) |
Serialize the kernel. More... | |
Private Attributes | |
double | bandwidth |
The bandwidth of the kernel. More... | |
The trivially simple triangular kernel, defined by.
where is the bandwidth of the kernel.
Definition at line 30 of file triangular_kernel.hpp.
|
inline |
Initialize the triangular kernel with the given bandwidth (default 1.0).
bandwidth | Bandwidth of the triangular kernel. |
Definition at line 38 of file triangular_kernel.hpp.
|
inline |
Get the bandwidth of the kernel.
Definition at line 84 of file triangular_kernel.hpp.
References bandwidth.
|
inline |
Modify the bandwidth of the kernel.
Definition at line 86 of file triangular_kernel.hpp.
References bandwidth.
|
inline |
Evaluate the triangular kernel for the two given vectors.
VecTypeA | Type of first vector. |
VecTypeB | Type of second vector. |
a | First vector. |
b | Second vector. |
Definition at line 49 of file triangular_kernel.hpp.
References bandwidth, and mlpack::metric::LMetric< TPower, TTakeRoot >::Evaluate().
|
inline |
Evaluate the triangular kernel given that the distance between the two points is known.
distance | The distance between the two points. |
Definition at line 61 of file triangular_kernel.hpp.
References bandwidth.
|
inline |
Evaluate the gradient of triangular kernel given that the distance between the two points is known.
distance | The distance between the two points. |
Definition at line 73 of file triangular_kernel.hpp.
References bandwidth.
|
inline |
Serialize the kernel.
Definition at line 90 of file triangular_kernel.hpp.
References bandwidth, and mlpack::data::CreateNVP().
|
private |
The bandwidth of the kernel.
Definition at line 97 of file triangular_kernel.hpp.
Referenced by Bandwidth(), Evaluate(), Gradient(), and Serialize().