public class CachingKernel extends NestedKernel
Caches the results of a nested kernel so that k(a, b) need only be calculated once.
This kernel is thread-safe. However, care must be taken when setting the nested kernel that no other thread is retrieving values at the same time. This would cause a race condition in which the newly flushed cache may contain a value from the previous kernel.
- Thomas Down, Matthew Pocock
- See Also:
- Serialized Form
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
evaluate(Object x, Object y)Return the dot product of two vectors in an arbitrary feature space.
setNestedKernel(SVMKernel k)Set the SVMKernel to nest to k.
public void setNestedKernel(SVMKernel k)Description copied from class:
NestedKernelSet the SVMKernel to nest to k.
evaluateDescription copied from interface:
SVMKernelReturn the dot product of two vectors in an arbitrary feature space. In this implementation, the `vectors' can actually be arbitrary objects.