36 virtual arma::mat
eval(
const arma::mat &X,
const arma::mat &Y,
37 bool diag =
false)
const = 0;
50 virtual arma::mat
derivate(
size_t param_id,
const arma::mat &X,
51 const arma::mat &Y,
bool diag =
false)
const = 0;
61 virtual void set_params(
const std::vector<double> ¶ms) = 0;
76 virtual std::vector<double>
get_params()
const = 0;
109 void set_kernel(
const std::shared_ptr<kernel_class> &k);
114 std::shared_ptr<kernel_class>
get_kernel()
const;
126 double train(
int max_iter,
double tol);
144 arma::vec
predict(
const arma::mat &new_data)
const;
164 const std::vector<std::shared_ptr<kernel_class>> &kernels,
165 const std::vector<arma::mat> ¶ms) {}
179 virtual arma::mat
eval(
const std::vector<arma::mat> &X,
180 const std::vector<arma::mat> &Y,
bool diag =
false)
const = 0;
193 virtual arma::mat
derivate(
size_t param_id,
const std::vector<arma::mat> &X,
194 const std::vector<arma::mat> &Y,
bool diag =
false)
const = 0;
199 virtual size_t n_params()
const = 0;
207 virtual void set_params_k(
const std::vector<arma::mat> ¶ms) = 0;
217 virtual void set_params(
const std::vector<double> ¶ms,
218 size_t n_outputs = 0) = 0;
225 const std::vector<std::shared_ptr<kernel_class>> &kernels) = 0;
231 virtual std::vector<arma::mat>
get_params_k()
const = 0;
236 virtual std::vector<double>
get_params()
const = 0;
241 virtual std::vector<std::shared_ptr<kernel_class>>
get_kernels()
const = 0;
305 void set_kernel(
const std::shared_ptr<multioutput_kernel_class> &k);
315 const std::vector<arma::vec> &y);
322 double train(
const int max_iter,
const double tol);
331 double train(
const int max_iter,
const double tol,
const size_t num_pi);
339 double train(
const int max_iter,
const double tol,
340 const std::vector<size_t> num_pi);
348 double train(
const int max_iter,
const double tol,
349 const std::vector<arma::mat> num_pi);
369 arma::vec
predict(
const std::vector<arma::mat> &new_data)
const;
384 void set_params(
const std::vector<double> ¶ms);
implementation * pimpl
Definition: gp.hpp:286
virtual arma::mat derivate(size_t param_id, const std::vector< arma::mat > &X, const std::vector< arma::mat > &Y, bool diag=false) const =0
Returns the value of the derivative wrt a certain parameter with a a particular pair of input matrice...
void set_kernel(const std::shared_ptr< multioutput_kernel_class > &k)
Sets the multioutput kernel to be used with the multioutput regression.
Definition: gpreg_multi.cc:270
mv_gauss full_predict(const std::vector< arma::mat > &new_data)
Uses the already trained model to predict output values for new inputs provided in the parameter...
Definition: gpreg_multi.cc:365
Definition: mvgauss.hpp:9
void set_training_set(const arma::mat &X, const arma::vec &y)
Sets the training set to be used during the training process.
Definition: gpreg.cc:92
Definition: gpreg_multi.cc:10
multioutput_kernel_class(const std::vector< std::shared_ptr< kernel_class >> &kernels, const std::vector< arma::mat > ¶ms)
Constructor, requires the inner kernels to be used and the parameter matrices.
Definition: gp.hpp:163
gp_reg()
Constructor.
Definition: gpreg.cc:76
virtual std::vector< double > get_params() const =0
Returns a std.
gp_reg_multi()
Constructor.
Definition: gpreg_multi.cc:262
virtual void set_lower_bounds(const double &lower_bounds)=0
Sets the lower bounds to be used by the kernel during training process including those of the inner k...
virtual ~kernel_class()=default
Destructor.
virtual void set_upper_bounds(const double &upper_bounds)=0
Sets the upper bounds to be used by the kernel during training process including those of the inner k...
~gp_reg()
Destructor.
Definition: gpreg.cc:80
virtual std::vector< std::shared_ptr< kernel_class > > get_kernels() const =0
Returns a Shared pointer to a vector containing the inner kernels currently set.
virtual std::vector< double > get_upper_bounds() const =0
Returns a vector with the upper bounds of all the parameters, including those of the inner kernels...
virtual void set_params_k(const std::vector< arma::mat > ¶ms)=0
Sets the parameters of the multioutput kernel only, doesn't affect the parameters of the inner kernel...
virtual void set_lower_bounds(const std::vector< double > &lower_bounds)=0
Sets the lower bounds to be used by the kernel during training process.
multioutput_kernel_class()
Multioutput Kernel Class definition.
Definition: gp.hpp:155
implementation * pimpl
Definition: gp.hpp:94
arma::vec predict(const std::vector< arma::mat > &new_data) const
Uses the already trained model to predict output values for new inputs provided in the parameter...
Definition: gpreg_multi.cc:372
virtual void set_params(const std::vector< double > ¶ms, size_t n_outputs=0)=0
Sets all the parameters of the multioutput kernel including those of the inner kernels using a std...
std::vector< double > get_params() const
Returns a vector with the complete set of parameters required by the multioutput regression (pseudo-i...
Definition: gpreg_multi.cc:381
virtual size_t n_params() const =0
Returns the total number of parameters needed bythe kernel (parameter matrices, plus the parameters o...
arma::vec predict(const arma::mat &new_data) const
Uses the already trained model to predict output values for new inputs provided in the parameter...
Definition: gpreg.cc:105
virtual void set_upper_bounds(const std::vector< double > &upper_bounds)=0
Sets the upper bounds to be used by the kernel during training process.
~gp_reg_multi()
Destructor.
Definition: gpreg_multi.cc:266
kernel_class()
Kernel Class definition.
Definition: gp.hpp:22
mv_gauss full_predict(const arma::mat &new_data) const
Uses the already trained model to predict output values for new inputs provided in the parameter...
Definition: gpreg.cc:101
void set_training_set(const std::vector< arma::mat > &X, const std::vector< arma::vec > &y)
Sets the pairs of known input and output data used to train the model.
Definition: gpreg_multi.cc:274
virtual std::vector< double > get_params() const =0
Returns a vector with the current values of the parameters of the kernel.
virtual void set_kernels(const std::vector< std::shared_ptr< kernel_class >> &kernels)=0
Sets the inner kernels.
virtual arma::mat eval(const std::vector< arma::mat > &X, const std::vector< arma::mat > &Y, bool diag=false) const =0
Evaluates the kernel function over the provided sets of matrices.
virtual arma::mat eval(const arma::mat &X, const arma::mat &Y, bool diag=false) const =0
Evaluates the kernel function over the provided matrices.
virtual size_t n_params() const =0
Returns the number of params needed by the kernel.
void set_kernel(const std::shared_ptr< kernel_class > &k)
Sets the kernel to be used during the regression process.
Definition: gpreg.cc:84
std::shared_ptr< kernel_class > get_kernel() const
Returns the current kernel set to be used during the regression process.
Definition: gpreg.cc:88
virtual ~multioutput_kernel_class()=default
Destructor.
virtual std::vector< arma::mat > get_params_k() const =0
Returns a vector of matrices containing the parameters of the multioutput kernel, but not those of th...
virtual arma::mat derivate(size_t param_id, const arma::mat &X, const arma::mat &Y, bool diag=false) const =0
Returns the value of the derivative wrt a certain parameter with a a particular pair of input matrice...
virtual void set_params(const std::vector< double > ¶ms)=0
Sets the parameters of the kernel using the proided vector.
double train(const int max_iter, const double tol)
Trains the model using the standard procedure, in accordance to the provided training set...
Definition: gpreg_multi.cc:281
virtual std::vector< double > get_lower_bounds() const =0
Returns a vector with the lower bounds of all the parameters, including those of the inner kernels...
void set_params(const std::vector< double > ¶ms)
Sets all the parameters of the multioutput regression using the Vector prvided.
Definition: gpreg_multi.cc:385
virtual std::vector< double > get_upper_bounds() const =0
Returns a vector with the current values of the upper_bounds for each of the parameters of the kernel...
virtual std::vector< double > get_lower_bounds() const =0
Returns a vector with the current values of the lower_bounds for each of the parameters of the kernel...
double train(int max_iter, double tol)
Trains the model using the provided training set.
Definition: gpreg.cc:97