mlpack
|
The Cauchy kernel. More...
#include <cauchy_kernel.hpp>
Public Member Functions | |
CauchyKernel (double bandwidth=1.0) | |
Construct the Cauchy kernel; by default, the bandwidth is 1.0. | |
template<typename VecTypeA , typename VecTypeB > | |
double | Evaluate (const VecTypeA &a, const VecTypeB &b) |
Evaluation of the Cauchy kernel. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the kernel. | |
The Cauchy kernel.
Given two vector \( x \), \( y \), and a bandwidth \( \sigma \) (set in the constructor),
\[ K(x, y) = \frac{1}{1 + (\frac{|| x - y ||}{\sigma})^2}. \]
For more details, see the following published paper:
|
inline |
Evaluation of the Cauchy kernel.
This could be generalized to use any distance metric, not the Euclidean distance, but for now, the Euclidean distance is used.
VecTypeA | Type of first vector (arma::vec, arma::sp_vec). |
VecTypeB | Type of second vector (arma::vec, arma::sp_vec). |
a | First vector. |
b | Second vector. |