34 using namespace shogun;
40 void CGaussianARDFITCKernel::init()
67 SG_SERROR(
"Provided kernel is not of type CGaussianARDFITCKernel!\n");
85 ker->CGaussianARDKernel::init(lhs,
rhs);
93 if (!strcmp(param->
m_name,
"latent_features"))
101 for (int32_t idx_r=0; idx_r<num_rhs; idx_r++)
105 linalg::add(left_vec, right_vec, right_vec, 1.0, -1.0);
115 weights.set_const(scalar_weight);
116 linalg::matrix_product(right_transpose, weights, res_transpose);
123 linalg::elementwise_product(right_transpose, weights, res_transpose);
127 linalg::matrix_product(right_transpose,
m_weights, res_transpose);
131 SG_ERROR(
"Unsupported ARD kernel\n");
136 for (
index_t i=0; i<left_vec.vlen; i++)
int32_t num_rhs
number of feature vectors on right hand side
virtual CSGObject * shallow_copy() const
SGMatrix< float64_t > m_weights
float64_t kernel(int32_t idx_a, int32_t idx_b)
virtual ~CGaussianARDFITCKernel()
Features that support dot products among other operations.
EARDKernelType m_ARD_type
int32_t cache_size
cache_size in MB
Gaussian Kernel with Automatic Relevance Detection computed on CDotFeatures.
Class SGObject is the base class of all shogun objects.
void add(Matrix A, Matrix B, Matrix C, typename Matrix::Scalar alpha=1.0, typename Matrix::Scalar beta=1.0)
int32_t num_lhs
number of feature vectors on left hand side
CFeatures * rhs
feature vectors to occur on right hand side
static CKernel * obtain_from_generic(CSGObject *kernel)
virtual EKernelType get_kernel_type()=0
CFeatures * lhs
feature vectors to occur on left hand side
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
Gaussian Kernel with Automatic Relevance Detection with supporting FITC inference.