39 initialize_sparse_kernel();
41 void CGaussianARDSparseKernel::initialize_sparse_kernel()
49 using namespace Eigen;
54 initialize_sparse_kernel();
61 initialize_sparse_kernel();
68 SG_SERROR(
"Provided kernel is not of type CGaussianARDSparseKernel!\n");
79 REQUIRE(param,
"Param not set\n");
80 if (!strcmp(param->
m_name,
"inducing_features"))
89 REQUIRE(param,
"Param not set\n");
90 if (!strcmp(param->
m_name,
"inducing_features"))
94 REQUIRE(index>=0 && index<
num_lhs,
"Index (%d) is out of bound (%d)\n",
104 for (int32_t idx_r=0; idx_r<
num_rhs; idx_r++)
118 eigen_res_col_vec=eigen_right_col_vec*scalar_weight;
125 eigen_res_col_vec=eigen_right_col_vec.cwiseProduct(eigen_weights);
130 eigen_res_col_vec=eigen_weights*eigen_right_col_vec;
139 res(i,idx_r)*=-
kernel(idx_l,idx_r);
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
SGVector< float64_t > m_log_weights
Gaussian Kernel with Automatic Relevance Detection with supporting Sparse inference.
virtual ~CGaussianARDSparseKernel()
int32_t num_rhs
number of feature vectors on right hand side
virtual SGVector< float64_t > get_parameter_gradient_diagonal(const TParameter *param, index_t index=-1)
virtual SGMatrix< float64_t > compute_right_product(SGVector< float64_t >vec, float64_t &scalar_weight)
void add(SGVector< T > &a, SGVector< T > &b, SGVector< T > &result, T alpha=1, T beta=1)
float64_t kernel(int32_t idx_a, int32_t idx_b)
Features that support dot products among other operations.
Gaussian Kernel with Automatic Relevance Detection computed on CDotFeatures.
SGMatrix< float64_t > m_weights_raw
T * get_column_vector(index_t col) const
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
virtual SGVector< float64_t > get_parameter_gradient_diagonal(const TParameter *param, index_t index=-1)
virtual SGVector< float64_t > get_feature_vector(int32_t idx, CFeatures *hs)
int32_t num_lhs
number of feature vectors on left hand side
void lazy_update_weights()
static CGaussianARDSparseKernel * obtain_from_generic(CKernel *kernel)
CGaussianARDSparseKernel()
CFeatures * rhs
feature vectors to occur on right hand side
all of classes and functions are contained in the shogun namespace
virtual EKernelType get_kernel_type()=0
EARDKernelType m_ARD_type
CFeatures * lhs
feature vectors to occur on left hand side
virtual SGVector< float64_t > get_parameter_gradient_diagonal(const TParameter *param, index_t index=-1)