gplib  1.0.0
C++ Gaussian Process Library
multioutput_kernels.hpp
Go to the documentation of this file.
1 #ifndef GPLIB_MULTIOUTPUT_KERNEL
2 #define GPLIB_MULTIOUTPUT_KERNEL
3 
4 #include "gp.hpp"
5 
6 namespace gplib{
7  namespace multioutput_kernels{
16  private:
19  public:
23  lmc_kernel();
31  lmc_kernel(const std::vector<std::shared_ptr<kernel_class>> &kernels,
32  const std::vector<arma::mat> &params);
33 
40  lmc_kernel(const size_t lf_number, size_t n_outputs);
41 
45  ~lmc_kernel();
46 
56  arma::mat eval(const std::vector<arma::mat> &X,
57  const std::vector<arma::mat> &Y, bool diag = false) const;
58 
71  arma::mat derivate(size_t param_id, const std::vector<arma::mat> &X,
72  const std::vector<arma::mat> &Y, bool diag = false) const;
73 
78  size_t n_params() const;
79 
87  void set_params_k(const std::vector<arma::mat> &params);
88 
98  void set_params(const std::vector<double> &params,
99  size_t n_outputs = 0);
100 
108  void set_param(size_t q, size_t a, size_t b, const double param);
109 
116  void set_param(size_t q, size_t param_id, const double param);
117 
123  void set_kernels(const std::vector<std::shared_ptr<kernel_class>>
124  &kernels);
125 
131  std::vector<arma::mat> get_params_k() const;
132 
137  std::vector<double> get_params() const;
138 
143  std::vector<std::shared_ptr<kernel_class>> get_kernels() const;
144 
152  double get_param(size_t q, size_t a, size_t b) const;
153 
160  double get_param(size_t q, size_t param_id) const;
161 
168  void set_lower_bounds(const double &lower_bounds);
169 
176  void set_upper_bounds(const double &upper_bounds);
177 
183  void set_lower_bounds(const std::vector<double> &lower_bounds);
184 
190  void set_upper_bounds(const std::vector<double> &upper_bounds);
191 
196  std::vector<double> get_lower_bounds() const;
197 
202  std::vector<double> get_upper_bounds() const;
203  };
204 
205  }
206 }
207 
208 #endif
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.
Definition: multioutput_kernels.cc:513
lmc_kernel()
Constructor.
Definition: multioutput_kernels.cc:495
size_t n_params() const
Returns the total number of parameters needed by the kernel (parameter matrices, plus the parameters ...
Definition: multioutput_kernels.cc:523
Definition: gp.hpp:147
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 matrice...
Definition: multioutput_kernels.cc:518
Linear model of coregionalization : http://www.jmlr.org/papers/volume12/alvarez11a/alvarez11a.pdf.
Definition: multioutput_kernels.hpp:12
std::vector< double > get_upper_bounds() const
Returns a vector with the upper bounds of all the parameters, including those of the inner kernels...
Definition: multioutput_kernels.cc:589
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 kernel...
Definition: multioutput_kernels.cc:527
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.
Definition: multioutput_kernels.cc:549
std::vector< double > get_params() const
Returns a std vector containing all of the parameters of the multioutput kernel, including those of e...
Definition: multioutput_kernels.cc:557
~lmc_kernel()
Destructor.
Definition: multioutput_kernels.cc:509
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.
Definition: multioutput_kernels.cc:535
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 k...
Definition: multioutput_kernels.cc:573
void set_kernels(const std::vector< std::shared_ptr< kernel_class >> &kernels)
Sets the inner kernels.
Definition: multioutput_kernels.cc:543
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 k...
Definition: multioutput_kernels.cc:569
std::vector< arma::mat > get_params_k() const
Returns a vector of matrices containing the parameters of the multioutput kernel, but not those of th...
Definition: multioutput_kernels.cc:561
Definition: multioutput_kernels.cc:9
implementation * pimpl
Definition: multioutput_kernels.hpp:17
Definition: basic.cc:6
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...
Definition: multioutput_kernels.cc:531
std::vector< double > get_lower_bounds() const
Returns a vector with the lower bounds of all the parameters, including those of the inner kernels...
Definition: multioutput_kernels.cc:585
std::vector< std::shared_ptr< kernel_class > > get_kernels() const
Returns a shared pointer to a vector containing the inner kernels currently set.
Definition: multioutput_kernels.cc:565