25 #ifndef _KERNEL_COMBINED_HPP_ 26 #define _KERNEL_COMBINED_HPP_ 28 #include <boost/numeric/ublas/vector_proxy.hpp> 43 virtual void init(
size_t input_dim,
Kernel* left,
Kernel* right)
50 void setHyperParameters(
const vectord &theta)
52 using boost::numeric::ublas::subrange;
54 size_t n_lhs = left->nHyperParameters();
55 size_t n_rhs = right->nHyperParameters();
56 if (theta.size() != n_lhs + n_rhs)
58 FILE_LOG(logERROR) <<
"Wrong number of kernel hyperparameters";
59 throw std::invalid_argument(
"Wrong number of kernel hyperparameters");
61 left->setHyperParameters(subrange(theta,0,n_lhs));
62 right->setHyperParameters(subrange(theta,n_lhs,n_lhs+n_rhs));
65 vectord getHyperParameters()
67 using boost::numeric::ublas::subrange;
69 size_t n_lhs = left->nHyperParameters();
70 size_t n_rhs = right->nHyperParameters();
71 vectord par(n_lhs + n_rhs);
72 subrange(par,0,n_lhs) = left->getHyperParameters();
73 subrange(par,n_lhs,n_lhs+n_rhs) = right->getHyperParameters();
77 size_t nHyperParameters()
79 size_t n_lhs = left->nHyperParameters();
80 size_t n_rhs = right->nHyperParameters();
Kernel (covariance) functions.
Namespace of the library interface.
Abstract class for combined kernel.
Interface for kernel functors.