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

Linear model of coregionalization : http://www.jmlr.org/papers/volume12/alvarez11a/alvarez11a.pdf. More...

#include <multioutput_kernels.hpp>

Inheritance diagram for gplib::multioutput_kernels::lmc_kernel:
Inheritance graph
[legend]
Collaboration diagram for gplib::multioutput_kernels::lmc_kernel:
Collaboration graph
[legend]

Classes

struct  implementation
 

Public Member Functions

 lmc_kernel ()
 Constructor. More...
 
 lmc_kernel (const std::vector< std::shared_ptr< kernel_class >> &kernels, const std::vector< arma::mat > &params)
 Constructor, requires the inner kernels to be used and the parameter matrices. More...
 
 lmc_kernel (const size_t lf_number, size_t n_outputs)
 Constructor, requires the number of latent functions and the number of outputs to be used, creates default kernels and parameters. More...
 
 ~lmc_kernel ()
 Destructor. More...
 
arma::mat eval (const std::vector< arma::mat > &X, const std::vector< arma::mat > &Y, bool diag=false) const
 Evaluates the kernel function over the provided sets of matrices. More...
 
arma::mat derivate (size_t param_id, const std::vector< arma::mat > &X, const std::vector< 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 total number of parameters needed by the kernel (parameter matrices, plus the parameters of each inner kernel). More...
 
void set_params_k (const std::vector< arma::mat > &params)
 Sets the parameters of the multioutput kernel only, doesn't affect the parameters of the inner kernels. More...
 
void set_params (const std::vector< double > &params, size_t n_outputs=0)
 Sets all the parameters of the multioutput kernel including those of the inner kernels using a std. More...
 
void set_param (size_t q, size_t a, size_t b, const double param)
 Sets the parameter of the matrix B in multioutput kernel. More...
 
void set_param (size_t q, size_t param_id, const double param)
 Sets the parameter of the matrix B in multioutput kernel. More...
 
void set_kernels (const std::vector< std::shared_ptr< kernel_class >> &kernels)
 Sets the inner kernels. More...
 
std::vector< arma::mat > get_params_k () const
 Returns a vector of matrices containing the parameters of the multioutput kernel, but not those of the inner kernels (in other words only the parameter matrices). More...
 
std::vector< double > get_params () const
 Returns a std vector containing all of the parameters of the multioutput kernel, including those of each inner kernel. More...
 
std::vector< std::shared_ptr< kernel_class > > get_kernels () const
 Returns a shared pointer to a vector containing the inner kernels currently set. More...
 
double get_param (size_t q, size_t a, size_t b) const
 Returns a double with a single parameter of the matrix B of the multioutput kernel. More...
 
double get_param (size_t q, size_t param_id) const
 Returns a double with a single parameter in the inner kernel of the multioutput kernel. More...
 
void set_lower_bounds (const double &lower_bounds)
 Sets the lower bounds to be used by the kernel during training process including those of the inner kernels. More...
 
void set_upper_bounds (const double &upper_bounds)
 Sets the upper bounds to be used by the kernel during training process including those of the inner kernels. More...
 
void set_lower_bounds (const std::vector< double > &lower_bounds)
 Sets the lower bounds to be used by the kernel during training process including thos of the inner kernels. More...
 
void set_upper_bounds (const std::vector< double > &upper_bounds)
 Sets the upper bounds to be used by the kernel during training process including thos of the inner kernels. More...
 
std::vector< double > get_lower_bounds () const
 Returns a vector with the lower bounds of all the parameters, including those of the inner kernels. More...
 
std::vector< double > get_upper_bounds () const
 Returns a vector with the upper bounds of all the parameters, including those of the inner kernels. More...
 
- Public Member Functions inherited from gplib::multioutput_kernel_class
 multioutput_kernel_class ()
 Multioutput Kernel Class definition. More...
 
 multioutput_kernel_class (const std::vector< std::shared_ptr< kernel_class >> &kernels, const std::vector< arma::mat > &params)
 Constructor, requires the inner kernels to be used and the parameter matrices. More...
 
virtual ~multioutput_kernel_class ()=default
 Destructor. More...
 

Private Attributes

implementationpimpl
 

Detailed Description

Linear model of coregionalization : http://www.jmlr.org/papers/volume12/alvarez11a/alvarez11a.pdf.

Constructor & Destructor Documentation

gplib::multioutput_kernels::lmc_kernel::lmc_kernel ( )

Constructor.

gplib::multioutput_kernels::lmc_kernel::lmc_kernel ( const std::vector< std::shared_ptr< kernel_class >> &  kernels,
const std::vector< arma::mat > &  params 
)

Constructor, requires the inner kernels to be used and the parameter matrices.

Parameters
kernels: Shared pointer containing a vector with the inner kernels (kernel_class).
params: Vector containing the parameter matrices.
gplib::multioutput_kernels::lmc_kernel::lmc_kernel ( const size_t  lf_number,
size_t  n_outputs 
)

Constructor, requires the number of latent functions and the number of outputs to be used, creates default kernels and parameters.

Parameters
lf_number: size_t, Number of latent functions.
n_outputs: size_t, Number of outputs.
gplib::multioutput_kernels::lmc_kernel::~lmc_kernel ( )

Destructor.

Member Function Documentation

mat gplib::multioutput_kernels::lmc_kernel::derivate ( size_t  param_id,
const std::vector< arma::mat > &  X,
const std::vector< 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 vector of matrices for derivative evaluation.
Y: Second vector of matrices 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::multioutput_kernel_class.

mat gplib::multioutput_kernels::lmc_kernel::eval ( const std::vector< arma::mat > &  X,
const std::vector< arma::mat > &  Y,
bool  diag = false 
) const
virtual

Evaluates the kernel function over the provided sets of matrices.

Parameters
X: First vector of matrices for kernel evaluation.
Y: Second vector of matrices 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::multioutput_kernel_class.

vector< shared_ptr< kernel_class > > gplib::multioutput_kernels::lmc_kernel::get_kernels ( ) const
virtual

Returns a shared pointer to a vector containing the inner kernels currently set.

Implements gplib::multioutput_kernel_class.

vector< double > gplib::multioutput_kernels::lmc_kernel::get_lower_bounds ( ) const
virtual

Returns a vector with the lower bounds of all the parameters, including those of the inner kernels.

Implements gplib::multioutput_kernel_class.

double gplib::multioutput_kernels::lmc_kernel::get_param ( size_t  q,
size_t  a,
size_t  b 
) const

Returns a double with a single parameter of the matrix B of the multioutput kernel.

Parameters
qidentifier of the latent function.
aidentifier of the param row.
bidentifier of the param col.
double gplib::multioutput_kernels::lmc_kernel::get_param ( size_t  q,
size_t  param_id 
) const

Returns a double with a single parameter in the inner kernel of the multioutput kernel.

Parameters
qidentifier of the inner kernel.
param_idthe identifier of the parameter.
vector< double > gplib::multioutput_kernels::lmc_kernel::get_params ( ) const
virtual

Returns a std vector containing all of the parameters of the multioutput kernel, including those of each inner kernel.

Implements gplib::multioutput_kernel_class.

vector< mat > gplib::multioutput_kernels::lmc_kernel::get_params_k ( ) const
virtual

Returns a vector of matrices containing the parameters of the multioutput kernel, but not those of the inner kernels (in other words only the parameter matrices).

Implements gplib::multioutput_kernel_class.

vector< double > gplib::multioutput_kernels::lmc_kernel::get_upper_bounds ( ) const
virtual

Returns a vector with the upper bounds of all the parameters, including those of the inner kernels.

Implements gplib::multioutput_kernel_class.

size_t gplib::multioutput_kernels::lmc_kernel::n_params ( ) const
virtual

Returns the total number of parameters needed by the kernel (parameter matrices, plus the parameters of each inner kernel).

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_kernels ( const std::vector< std::shared_ptr< kernel_class >> &  kernels)
virtual

Sets the inner kernels.

Parameters
kernels: Shared pointer containing a vector of kernel_class kernels.

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_lower_bounds ( const double &  lower_bounds)
virtual

Sets the lower bounds to be used by the kernel during training process including those of the inner kernels.

Parameters
lower_bounds: double, the lower bounds of all the parameters will be set to this value.

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_lower_bounds ( const std::vector< double > &  lower_bounds)
virtual

Sets the lower bounds to be used by the kernel during training process including thos of the inner kernels.

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

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_param ( size_t  q,
size_t  a,
size_t  b,
const double  param 
)

Sets the parameter of the matrix B in multioutput kernel.

Parameters
qidentifier of the latent function.
aidentifier of the parameter row.
bidentifier of the parameter col.
paramthe value of the parameter to be set.
void gplib::multioutput_kernels::lmc_kernel::set_param ( size_t  q,
size_t  param_id,
const double  param 
)

Sets the parameter of the matrix B in multioutput kernel.

Parameters
qidentifier of the inner kernel.
param_ididentifier of the parameter.
paramthe value of the parameter to be set.
void gplib::multioutput_kernels::lmc_kernel::set_params ( const std::vector< double > &  params,
size_t  n_outputs = 0 
)
virtual

Sets all the parameters of the multioutput kernel including those of the inner kernels using a std.

vector.

Parameters
params: vector containing all the parameters needed by the multioutput kernel.
n_outputs: If passed a number bigger than 0 the parameter matrices will be shaped according to the number received.

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_params_k ( const std::vector< arma::mat > &  params)
virtual

Sets the parameters of the multioutput kernel only, doesn't affect the parameters of the inner kernels.

Parameters
params: Vector of matrices containing the parameters the size of the vector should be the same as the number of latent functions (inner kernels).

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_upper_bounds ( const double &  upper_bounds)
virtual

Sets the upper bounds to be used by the kernel during training process including those of the inner kernels.

Parameters
upper_bounds: double, the upper bounds of all the parameters will be set to this value.

Implements gplib::multioutput_kernel_class.

void gplib::multioutput_kernels::lmc_kernel::set_upper_bounds ( const std::vector< double > &  upper_bounds)
virtual

Sets the upper bounds to be used by the kernel during training process including thos of the inner kernels.

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

Implements gplib::multioutput_kernel_class.

Member Data Documentation

implementation* gplib::multioutput_kernels::lmc_kernel::pimpl
private

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