31 void CExponentialARDKernel::init()
56 REQUIRE(hs,
"Features not set!\n");
62 REQUIRE(dot_hs,
"Kernel only supports DotFeatures\n");
127 REQUIRE(weight>0,
"Scalar (%f) weight should be positive\n",weight);
139 "Setting vector weights must be before initialize features\n");
140 REQUIRE(weights.
vlen>0,
"Vector weight should be non-empty\n");
144 REQUIRE(weights[i]>0,
"Each entry of vector weight (v[%d]=%f) should be positive\n",
157 "Setting matrix weights must be before initialize features\n");
160 "Number of row (%d) must be not less than number of column (%d)",
173 REQUIRE(begin[i]>0,
"The diagonal entry of matrix weight (w(%d,%d)=%f) should be positive\n",
196 CDotKernel::init(l, r);
197 int32_t dim=((
CDotFeatures*) l)->get_dim_feature_space();
274 REQUIRE(index>=0,
"Index (%d) must be non-negative\n",index);
SGVector< float64_t > m_log_weights
virtual void update_parameter_hash()
virtual ~CExponentialARDKernel()
virtual SGMatrix< float64_t > compute_right_product(SGVector< float64_t >vec, float64_t &scalar_weight)
virtual void set_weights(SGMatrix< float64_t > weights)
auto elementwise_compute(Operand operand, UnaryOp unary_op) -> typename Operand::template container_type< decltype(unary_op(operand.data()[0]))>
virtual void set_scalar_weights(float64_t weight)
Features that support dot products among other operations.
SGMatrix< float64_t > get_weighted_vector(SGVector< float64_t > vec)
ST * get_feature_vector(int32_t num, int32_t &len, bool &dofree)
SGMatrix< float64_t > m_weights_raw
Template class DotKernel is the base class for kernels working on DotFeatures.
T * get_column_vector(index_t col) const
virtual SGMatrix< float64_t > get_weights()
virtual SGVector< float64_t > get_feature_vector(int32_t idx, CFeatures *hs)
void lazy_update_weights()
void set_const(T const_elem)
virtual bool init_normalizer()
void matrix_prod(SGMatrix< T > &A, SGVector< T > &b, SGVector< T > &result, bool transpose=false)
virtual void check_weight_gradient_index(index_t index)
CFeatures * rhs
feature vectors to occur on right hand side
virtual void set_vector_weights(SGVector< float64_t > weights)
all of classes and functions are contained in the shogun namespace
EARDKernelType m_ARD_type
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
static float64_t exp(float64_t x)
static float64_t log(float64_t v)
SGVector< float64_t > get_computed_dot_feature_vector(int32_t num)
void set_const(T const_elem)
virtual void set_matrix_weights(SGMatrix< float64_t > weights)
void element_prod(Block< SGMatrix< T >> &a, Block< SGMatrix< T >> &b, SGMatrix< T > &result)
virtual bool parameter_hash_changed()
SGVector< T > clone() const