@References(references={@Reference(type=Article,author={"Vedaldi, A.","Zisserman, A."},title="Efficient Additive Kernels via Explicit Feature Maps",year="2012",journal="Pattern Analysis and Machine Intelligence, IEEE Transactions on",pages={"480","492"},number="3",volume="34",customData={"keywords","approximation theory;computer vision;data handling;feature extraction;learning (artificial intelligence);spectral analysis;support vector machines;Nystrom approximation;additive homogeneous kernels;approximate finite-dimensional feature maps;approximation error;computer vision;data dependency;explicit feature maps;exponential decay;large scale nonlinear support vector machines;linear SVM;spectral analysis;Additives;Approximation methods;Histograms;Kernel;Measurement;Support vector machines;Training;Kernel methods;feature map;large scale learning;object detection.;object recognition","doi","10.1109/TPAMI.2011.153","ISSN","0162-8828"}),@Reference(type=Inproceedings,author={"A. Vedaldi","A. Zisserman"},title="Efficient Additive Kernels via Explicit Feature Maps",year="2010",booktitle="Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)")}) public class HomogeneousKernelMap extends Object
This implementation is based directly on the VLFeat implementation written by Andrea Verdaldi, although it has been refactored to better fit with Java conventions.
| Modifier and Type | Class and Description |
|---|---|
static class |
HomogeneousKernelMap.ExtractorWrapper<T>
Helper implementation of a
FeatureExtractor that wraps another
FeatureExtractor and then applies the
HomogeneousKernelMap to the output before returning the vector. |
static class |
HomogeneousKernelMap.KernelType
Types of supported kernel for the
HomogeneousKernelMap |
static class |
HomogeneousKernelMap.WindowType
Types of window supported by the
HomogeneousKernelMap. |
| Constructor and Description |
|---|
HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType,
double gamma,
HomogeneousKernelMap.WindowType windowType)
Construct with the given kernel, gamma and window.
|
HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType,
double gamma,
int order,
double period,
HomogeneousKernelMap.WindowType windowType)
Construct with the given kernel, gamma, order, period and window.
|
HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType,
double gamma,
int order,
HomogeneousKernelMap.WindowType windowType)
Construct with the given kernel, gamma, order and window.
|
HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType,
HomogeneousKernelMap.WindowType windowType)
Construct with the given kernel and window.
|
| Modifier and Type | Method and Description |
|---|---|
<T> FeatureExtractor<DoubleFV,T> |
createWrappedExtractor(FeatureExtractor<? extends FeatureVector,T> inner)
Construct a new
HomogeneousKernelMap.ExtractorWrapper that applies the map to features
extracted by an internal extractor. |
void |
evaluate(double[] destination,
int stride,
int offset,
double x)
Evaluate the kernel for the given
x value. |
DoubleFV |
evaluate(DoubleFV in)
Compute the Homogeneous Kernel Map approximation of the given feature
vector
|
public HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType, HomogeneousKernelMap.WindowType windowType)
kernelType - the type of kernelwindowType - the type of window (use HomogeneousKernelMap.WindowType.Rectangular if
unsure)public HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType, double gamma, HomogeneousKernelMap.WindowType windowType)
kernelType - the type of kernelgamma - the gamma value. the standard kernels are 1-homogeneous, but
smaller values can work better in practice.windowType - the type of window (use HomogeneousKernelMap.WindowType.Rectangular if
unsure)public HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType, double gamma, int order, HomogeneousKernelMap.WindowType windowType)
kernelType - the type of kernelgamma - the gamma value. the standard kernels are 1-homogeneous, but
smaller values can work better in practice.order - the approximation order (usually 1 is enough)windowType - the type of window (use HomogeneousKernelMap.WindowType.Rectangular if
unsure)public HomogeneousKernelMap(HomogeneousKernelMap.KernelType kernelType, double gamma, int order, double period, HomogeneousKernelMap.WindowType windowType)
kernelType - the type of kernelgamma - the gamma value. the standard kernels are 1-homogeneous, but
smaller values can work better in practice.order - the approximation order (usually 1 is enough)period - the periodicity of the kernel spectrumwindowType - the type of window (use HomogeneousKernelMap.WindowType.Rectangular if
unsure)public void evaluate(double[] destination, int stride, int offset, double x)
x value. The output values
will be written into the destination array at
offset + j*stride intervals where j is between
0 and 2 * order + 1.destination - the destination arraystride - the strideoffset - the offsetx - the value to compute the kernel approximation forpublic DoubleFV evaluate(DoubleFV in)
in - the feature vectorpublic <T> FeatureExtractor<DoubleFV,T> createWrappedExtractor(FeatureExtractor<? extends FeatureVector,T> inner)
HomogeneousKernelMap.ExtractorWrapper that applies the map to features
extracted by an internal extractor.T - Type of object that features can be extracted frominner - the internal extractorFeatureExtractor