gplib  1.0.0
C++ Gaussian Process Library
Classes | Public Member Functions | Private Attributes | List of all members
gplib::kernels::squared_exponential Class Reference

Squared exponential kernel with noise inference. More...

#include <kernels.hpp>

Inheritance diagram for gplib::kernels::squared_exponential:
Inheritance graph
[legend]
Collaboration diagram for gplib::kernels::squared_exponential:
Collaboration graph
[legend]

Classes

struct  implementation
 

Public Member Functions

 squared_exponential ()
 Constructor. More...
 
 squared_exponential (const std::vector< double > &params)
 Constructor, requires the hyperparameter. More...
 
 ~squared_exponential ()
 Destructor. More...
 
arma::mat eval (const arma::mat &X, const arma::mat &Y, bool diag=false) const
 Evaluates the kernel function over the provided matrices. More...
 
arma::mat derivate (size_t param_id, const arma::mat &X, const arma::mat &Y, bool diag=false) const
 Returns the value of the derivative wrt a certain parameter with a a particular pair of input matrices. More...
 
size_t n_params () const
 Returns the number of params needed by the kernel. More...
 
void set_params (const std::vector< double > &params)
 Sets the parameters of the kernel using the proided vector. More...
 
void set_lower_bounds (const std::vector< double > &lower_bounds)
 Sets the lower bounds to be used by the kernel during training process. More...
 
void set_upper_bounds (const std::vector< double > &upper_bounds)
 Sets the upper bounds to be used by the kernel during training process. More...
 
std::vector< double > get_params () const
 Returns a vector with the current values of the parameters of the kernel. More...
 
std::vector< double > get_lower_bounds () const
 Returns a vector with the current values of the lower_bounds for each of the parameters of the kernel. More...
 
std::vector< double > get_upper_bounds () const
 Returns a vector with the current values of the upper_bounds for each of the parameters of the kernel. More...
 
- Public Member Functions inherited from gplib::kernel_class
 kernel_class ()
 Kernel Class definition. More...
 
virtual ~kernel_class ()=default
 Destructor. More...
 

Private Attributes

implementationpimpl
 

Detailed Description

Squared exponential kernel with noise inference.

This kernel is defined as: sig ^ 2 * exp(- ((x - xp) * (x - xp)')/ 2 * l) + sig_noise ^ 2 * I

Note
params : vector of hyperparameters 0 : sig, 1 : l (length scale), 2 : sig_noise.

Constructor & Destructor Documentation

gplib::kernels::squared_exponential::squared_exponential ( )

Constructor.

gplib::kernels::squared_exponential::squared_exponential ( const std::vector< double > &  params)

Constructor, requires the hyperparameter.

Parameters
params: Vector of hyperparameters
gplib::kernels::squared_exponential::~squared_exponential ( )

Destructor.

Member Function Documentation

mat gplib::kernels::squared_exponential::derivate ( size_t  param_id,
const arma::mat &  X,
const arma::mat &  Y,
bool  diag = false 
) const
virtual

Returns the value of the derivative wrt a certain parameter with a a particular pair of input matrices.

Parameters
param_id: Identifier of the parameter we are derivating with respect to.
X: First matrix for derivative evaluation.
Y: Second matrix for derivative evaluation.
diag: Flag, if it is true the kernel should only be evaluated for the derivative entries pertaining to the diagonal of the answer matrix, this is due to performance reasons while using FITC.

Implements gplib::kernel_class.

mat gplib::kernels::squared_exponential::eval ( const arma::mat &  X,
const arma::mat &  Y,
bool  diag = false 
) const
virtual

Evaluates the kernel function over the provided matrices.

Parameters
X: First matrix for kernel evaluation.
Y: Second matrix for kernel evaluation.
diag: Flag, if it is true the kernel should only be evaluated for the entries pertaining to the diagonal of the answer matrix, this is due to performance reasons while using FITC.

Implements gplib::kernel_class.

vector< double > gplib::kernels::squared_exponential::get_lower_bounds ( ) const
virtual

Returns a vector with the current values of the lower_bounds for each of the parameters of the kernel.

Implements gplib::kernel_class.

vector< double > gplib::kernels::squared_exponential::get_params ( ) const
virtual

Returns a vector with the current values of the parameters of the kernel.

Implements gplib::kernel_class.

vector< double > gplib::kernels::squared_exponential::get_upper_bounds ( ) const
virtual

Returns a vector with the current values of the upper_bounds for each of the parameters of the kernel.

Implements gplib::kernel_class.

size_t gplib::kernels::squared_exponential::n_params ( ) const
virtual

Returns the number of params needed by the kernel.

Implements gplib::kernel_class.

void gplib::kernels::squared_exponential::set_lower_bounds ( const std::vector< double > &  lower_bounds)
virtual

Sets the lower bounds to be used by the kernel during training process.

Parameters
lower_bounds: Vector containing the lower bounds to be used.

Implements gplib::kernel_class.

void gplib::kernels::squared_exponential::set_params ( const std::vector< double > &  params)
virtual

Sets the parameters of the kernel using the proided vector.

Parameters
params: vector containing all the parameters needed by the kernel.

Implements gplib::kernel_class.

void gplib::kernels::squared_exponential::set_upper_bounds ( const std::vector< double > &  upper_bounds)
virtual

Sets the upper bounds to be used by the kernel during training process.

Parameters
upper_bounds: Vector containing the upper bounds to be used.

Implements gplib::kernel_class.

Member Data Documentation

implementation* gplib::kernels::squared_exponential::pimpl
private

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