21 SG_INFO(
"Product kernel created (%p)\n",
this)
29 SG_INFO(
"Product kernel deleted (%p).\n",
this)
52 SG_ERROR(
"Kernel at position %d is NULL\n", k_idx);
65 SG_ERROR(
"ProductKernel: Number of features/kernels does not match - bailing out\n")
69 result=k->
init(lf,rf);
79 SG_DEBUG(
"Initializing 0x%p - \"%s\" (skipping init, this is a CUSTOM kernel)\n",
this, k->
get_name())
81 SG_ERROR(
"No kernel matrix was assigned to this Custom kernel\n")
93 SG_INFO(
"ProductKernel: Initialising the following kernel failed\n")
106 SG_ERROR(
"ProductKernel: Number of features/kernels does not match - bailing out\n")
179 SG_INFO(
"BEGIN PRODUCT KERNEL LIST - ")
188 SG_INFO(
"END PRODUCT KERNEL LIST - ")
227 void CProductKernel::init()
248 bool found_derivative=
false;
252 for (
int h=0; h<temp_kernel.
num_cols; h++)
253 temp_kernel(g,h)=1.0;
265 found_derivative=
true;
269 temp_kernel(g,h)*=derivative(g,h);
277 temp_kernel(g,h)*=cur_matrix(g,h);
284 if (found_derivative)
virtual const char * get_name() const =0
virtual bool init(CFeatures *lhs, CFeatures *rhs)
int32_t num_rhs
number of feature vectors on right hand side
The Custom Kernel allows for custom user provided kernel matrices.
int32_t get_num_subkernels()
SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
CProductKernel(int32_t size=10)
virtual void remove_lhs_and_rhs()
float64_t kernel(int32_t idx_a, int32_t idx_b)
virtual void remove_rhs()
takes all necessary steps if the rhs is removed from kernel
virtual int32_t get_num_vec_lhs()
SGMatrix< float64_t > get_kernel_matrix()
virtual void remove_rhs()
virtual void remove_lhs_and_rhs()
virtual void remove_lhs()
Class SGObject is the base class of all shogun objects.
float64_t get_combined_kernel_weight()
virtual EFeatureClass get_feature_class() const =0
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
int32_t num_lhs
number of feature vectors on left hand side
virtual int32_t get_num_vec_rhs()
virtual ~CProductKernel()
CDynamicObjectArray * kernel_array
CKernel * get_kernel(int32_t idx)
all of classes and functions are contained in the shogun namespace
virtual EKernelType get_kernel_type()=0
The class Features is the base class of all feature objects.
virtual SGMatrix< float64_t > get_parameter_gradient(const TParameter *param, index_t index=-1)
virtual float64_t compute(int32_t x, int32_t y)
virtual void remove_lhs()
virtual bool has_features()
The class CombinedFeatures is used to combine a number of of feature objects into a single CombinedFe...
virtual bool init(CFeatures *lhs, CFeatures *rhs)
virtual EFeatureType get_feature_type() const =0
bool append_element(CSGObject *e)
bool precompute_subkernels()