An experimental kernel inspired by the WeightedDegreePositionStringKernel and the Gaussian kernel.
It is computed as
where is the kernel width. The idea is to shift the dimensions of the input vectors against eachother.
is the step size (parameter shift_step) of the shifts and
(parameter max_shift) is the maximal shift.
Definition at line 34 of file GaussianShiftKernel.h.
Public Member Functions | |
CGaussianShiftKernel (int32_t size, float64_t width, int32_t max_shift, int32_t shift_step) | |
CGaussianShiftKernel (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r, float64_t width, int32_t max_shift, int32_t shift_step, int32_t size=10) | |
virtual | ~CGaussianShiftKernel () |
virtual EKernelType | get_kernel_type () |
virtual const char * | get_name () const |
Protected Member Functions | |
virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
Protected Attributes | |
int32_t | max_shift |
int32_t | shift_step |
CGaussianShiftKernel::CGaussianShiftKernel | ( | int32_t | size, | |
float64_t | width, | |||
int32_t | max_shift, | |||
int32_t | shift_step | |||
) |
constructor
size | cache size | |
width | width | |
max_shift | maximum shift | |
shift_step | shift step |
Definition at line 17 of file GaussianShiftKernel.cpp.
CGaussianShiftKernel::CGaussianShiftKernel | ( | CSimpleFeatures< float64_t > * | l, | |
CSimpleFeatures< float64_t > * | r, | |||
float64_t | width, | |||
int32_t | max_shift, | |||
int32_t | shift_step, | |||
int32_t | size = 10 | |||
) |
constructor
l | features of left-hand side | |
r | features of right-hand side | |
width | width | |
max_shift | maximum shift | |
shift_step | shift step | |
size | cache size |
Definition at line 23 of file GaussianShiftKernel.cpp.
CGaussianShiftKernel::~CGaussianShiftKernel | ( | ) | [virtual] |
Definition at line 31 of file GaussianShiftKernel.cpp.
float64_t CGaussianShiftKernel::compute | ( | int32_t | idx_a, | |
int32_t | idx_b | |||
) | [protected, virtual] |
compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
idx_a | index a | |
idx_b | index b |
Reimplemented from CGaussianKernel.
Definition at line 35 of file GaussianShiftKernel.cpp.
virtual EKernelType CGaussianShiftKernel::get_kernel_type | ( | ) | [virtual] |
return what type of kernel we are
Reimplemented from CGaussianKernel.
Definition at line 68 of file GaussianShiftKernel.h.
virtual const char* CGaussianShiftKernel::get_name | ( | ) | const [virtual] |
return the kernel's name
Reimplemented from CGaussianKernel.
Definition at line 74 of file GaussianShiftKernel.h.
int32_t CGaussianShiftKernel::max_shift [protected] |
maximum shift
Definition at line 89 of file GaussianShiftKernel.h.
int32_t CGaussianShiftKernel::shift_step [protected] |
shift step
Definition at line 91 of file GaussianShiftKernel.h.