public abstract class Kernel extends Object
Constructor and Description |
---|
Kernel() |
Modifier and Type | Method and Description |
---|---|
void |
disableCache()
Disables the kernel cache
|
long |
getKernelComputations()
Returns the number of times the kernel function has been invoked
|
long |
getNumberOfHits()
Returns the number of times a cache hit happened
|
long |
getNumberOfMisses()
Returns the number of times a cache miss happened
|
float |
innerProduct(Example exA,
Example exB)
Returns the kernel similarity between the given examples.
|
protected abstract float |
kernelComputation(Example exA,
Example exB)
Returns the kernel similarity between the given examples.
|
void |
reset()
Resets the kernel statistics (number of kernel computations,
cache hits and misses)
|
void |
setKernelCache(KernelCache cache)
Sets the cache in which storing the kernel operations in the RKHS defined
by this kernel
|
void |
setNormCache(SquaredNormCache normCache)
Sets the cache in which storing the quadratic norms in the RKHS defined
by this kernel
|
float |
squaredNorm(Example example)
Returns the squared norm of the given example in the RKHS defined by this kernel
|
float |
squaredNormOfTheDifference(Example exA,
Example exB)
Returns the squared norm of the difference between the given examples in the RKHS.
|
public final float innerProduct(Example exA, Example exB)
exA
- the first exampleexB
- the second exampleexA
and
exB
public void setNormCache(SquaredNormCache normCache)
normCache
- the cache for the quadratic normspublic void setKernelCache(KernelCache cache)
cache
- the cache for the kernel operationsprotected abstract float kernelComputation(Example exA, Example exB)
exA
- the first exampleexB
- the second exampleexA
and
exB
public float squaredNorm(Example example)
example
- the example whose squared norm must be computedpublic float squaredNormOfTheDifference(Example exA, Example exB)
exA
- the first exampleexB
- the second examplepublic void disableCache()
public long getKernelComputations()
public long getNumberOfHits()
public long getNumberOfMisses()
public void reset()
Copyright © 2014 Semantic Analytics Group @ Uniroma2. All rights reserved.