MLPACK  1.0.4
Public Member Functions | Private Attributes
mlpack::kernel::LaplacianKernel Class Reference

The standard Laplacian kernel. More...

List of all members.

Public Member Functions

 LaplacianKernel ()
 Default constructor; sets bandwidth to 1.0.
 LaplacianKernel (double bandwidth)
 Construct the Laplacian kernel with a custom bandwidth.
double Bandwidth () const
 Get the bandwidth.
double & Bandwidth ()
 Modify the bandwidth.
template<typename VecType >
double Evaluate (const VecType &a, const VecType &b) const
 Evaluation of the Laplacian kernel.
double Evaluate (double t) const
 Evaluation of the Laplacian kernel using a double precision argument.

Private Attributes

double bandwidth
 Kernel bandwidth.

Detailed Description

The standard Laplacian kernel.

Given two vectors $ x $, $ y $, and a bandwidth $ \mu $ (set in the constructor),

\[ K(x, y) = \exp(-\frac{|| x - y ||}{\mu}). \]

The implementation is all in the header file because it is so simple.

Definition at line 40 of file laplacian_kernel.hpp.


Constructor & Destructor Documentation

Default constructor; sets bandwidth to 1.0.

Definition at line 46 of file laplacian_kernel.hpp.

mlpack::kernel::LaplacianKernel::LaplacianKernel ( double  bandwidth) [inline]

Construct the Laplacian kernel with a custom bandwidth.

Parameters:
bandwidthThe bandwidth of the kernel ( $\mu$).

Definition at line 54 of file laplacian_kernel.hpp.


Member Function Documentation

double mlpack::kernel::LaplacianKernel::Bandwidth ( ) const [inline]

Get the bandwidth.

Definition at line 90 of file laplacian_kernel.hpp.

References bandwidth.

Modify the bandwidth.

Definition at line 92 of file laplacian_kernel.hpp.

References bandwidth.

template<typename VecType >
double mlpack::kernel::LaplacianKernel::Evaluate ( const VecType &  a,
const VecType &  b 
) const [inline]

Evaluation of the Laplacian kernel.

This could be generalized to use any distance metric, not the Euclidean distance, but for now, the Euclidean distance is used.

Template Parameters:
VecTypeType of vector (likely arma::vec or arma::spvec).
Parameters:
aFirst vector.
bSecond vector.
Returns:
K(a, b) using the bandwidth ( $\mu$) specified in the constructor.

Definition at line 70 of file laplacian_kernel.hpp.

References bandwidth, and mlpack::metric::LMetric< Power, TakeRoot >::Evaluate().

double mlpack::kernel::LaplacianKernel::Evaluate ( double  t) const [inline]

Evaluation of the Laplacian kernel using a double precision argument.

Parameters:
tdouble value.
Returns:
K(t) using the bandwidth ( $\mu$) specified in the constructor.

Definition at line 83 of file laplacian_kernel.hpp.

References bandwidth.


Member Data Documentation

Kernel bandwidth.

Definition at line 96 of file laplacian_kernel.hpp.

Referenced by Bandwidth(), and Evaluate().


The documentation for this class was generated from the following file: