23 #ifndef _KERNEL_LINEAR_HPP_ 24 #define _KERNEL_LINEAR_HPP_ 38 void init(
size_t input_dim)
39 { n_params = 0; n_inputs = input_dim; };
41 double operator()(
const vectord &x1,
const vectord &x2)
43 assert(x1.size() == x2.size());
44 return boost::numeric::ublas::inner_prod(x1,x2);
48 double gradient(
const vectord &x1,
const vectord &x2,
50 { assert(
false);
return 0.0; };
57 void init(
size_t input_dim)
58 { n_params = input_dim; n_inputs = input_dim; };
60 double operator()(
const vectord &x1,
const vectord &x2)
62 assert(x1.size() == x2.size());
65 return boost::numeric::ublas::inner_prod(v1,v2);
69 double gradient(
const vectord &x1,
const vectord &x2,
71 { assert(
false);
return 0.0; };
Namespace of the library interface.
v1 ublas_elementwise_div(const v1 &a, const v2 &b)
Computes the elementwise division of two vectors or matrices.
Atomic (simple) kernel functions.
Abstract class for an atomic kernel.