34 #ifdef HAVE_LINALG_LIB
42 initialize_sparse_kernel();
44 void CGaussianARDSparseKernel::initialize_sparse_kernel()
52 #ifdef HAVE_LINALG_LIB
53 using namespace Eigen;
58 initialize_sparse_kernel();
65 initialize_sparse_kernel();
72 SG_SERROR(
"Provided kernel is not of type CGaussianARDSparseKernel!\n");
83 REQUIRE(param,
"Param not set\n");
84 if (!strcmp(param->
m_name,
"inducing_features"))
93 REQUIRE(param,
"Param not set\n");
94 if (!strcmp(param->
m_name,
"inducing_features"))
98 REQUIRE(index>=0 && index<
num_lhs,
"Index (%d) is out of bound (%d)\n",
106 lazy_update_weights();
108 for (int32_t idx_r=0; idx_r<
num_rhs; idx_r++)
122 eigen_res_col_vec=eigen_right_col_vec*scalar_weight;
129 eigen_res_col_vec=eigen_right_col_vec.cwiseProduct(eigen_weights);
134 eigen_res_col_vec=eigen_weights*eigen_right_col_vec;
143 res(i,idx_r)*=-
kernel(idx_l,idx_r);
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
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
void add(Matrix A, Matrix B, Matrix C, typename Matrix::Scalar alpha=1.0, typename Matrix::Scalar beta=1.0)
virtual SGVector< float64_t > get_feature_vector(int32_t idx, CFeatures *hs)
int32_t num_lhs
number of feature vectors on left hand side
CGaussianARDSparseKernel()
CFeatures * rhs
feature vectors to occur on right hand side
static CKernel * obtain_from_generic(CSGObject *kernel)
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 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)