Gaussian or radial basis function kernel. More...
#include <Kernel.hpp>
Public Member Functions | |
GaussKernel (DenseMatrix< scalar_t > &data, scalar_t h, scalar_t lambda) | |
Public Member Functions inherited from strumpack::kernel::Kernel< scalar_t > | |
Kernel (DenseM_t &data, scalar_t lambda) | |
virtual | ~Kernel ()=default |
std::size_t | n () const |
std::size_t | d () const |
virtual scalar_t | eval (std::size_t i, std::size_t j) const |
void | operator() (const std::vector< std::size_t > &I, const std::vector< std::size_t > &J, DenseMatrix< real_t > &B) const |
void | operator() (const std::vector< std::size_t > &I, const std::vector< std::size_t > &J, DenseMatrix< std::complex< real_t >> &B) const |
DenseM_t | fit_HSS (std::vector< scalar_t > &labels, const HSS::HSSOptions< scalar_t > &opts) |
std::vector< scalar_t > | predict (const DenseM_t &test, const DenseM_t &weights) const |
DistM_t | fit_HSS (const BLACSGrid &grid, std::vector< scalar_t > &labels, const HSS::HSSOptions< scalar_t > &opts) |
std::vector< scalar_t > | predict (const DenseM_t &test, const DistM_t &weights) const |
DenseM_t | fit_HODLR (const MPIComm &c, std::vector< scalar_t > &labels, const HODLR::HODLROptions< scalar_t > &opts) |
const DenseM_t & | data () const |
DenseM_t & | data () |
std::vector< int > & | permutation () |
const std::vector< int > & | permutation () const |
virtual void | permute () |
Gaussian or radial basis function kernel.
Implements the kernel: \(\exp \left( -\frac{\|x-y\|_2^2}{2 h^2} \right)\), with an extra regularization parameter lambda on the diagonal.
This is a subclass of Kernel. It only implements the (protected) eval_kernel_function routine, the rest of the functionality is inherited. To create your own kernel, simply copy this class, rename and change the eval_kernel_function implementation.
|
inline |
Constructor of the kernel object.
data | Data defining the kernel matrix. data.rows() is the number of features, and data.cols() is the number of data points, ie, the dimension of the kernel matrix. |
h | Kernel width |
lambda | Regularization parameter, added to the diagonal |