public class NormKernel extends java.lang.Object implements Kernel
k(x,y)/sqrt(k(x,x)*k(y,y)
. If
the object is a org.apache.ctakes.ytex.kernel.Node, then save the norm in the node for future
reference. else if cacheNorm = true, save the norm in the cache for future
reference. If the delegate kernel is fast (e.g. it's using caching itself /
trivial operation) caching the norm will slow things down.Modifier and Type | Field and Description |
---|---|
private CacheManager |
cacheManager |
private boolean |
cacheNorm |
private Kernel |
delegateKernel |
private static Log |
log |
private Cache |
normCache |
Constructor and Description |
---|
NormKernel() |
NormKernel(Kernel delegateKernel) |
Modifier and Type | Method and Description |
---|---|
double |
evaluate(java.lang.Object o1,
java.lang.Object o2) |
CacheManager |
getCacheManager() |
Kernel |
getDelegateKernel() |
double |
getNorm(java.lang.Object o1)
compute the norm.
|
void |
init() |
boolean |
isCacheNorm() |
void |
setCacheManager(CacheManager cacheManager) |
void |
setCacheNorm(boolean cacheNorm) |
void |
setDelegateKernel(Kernel delegateKernel) |
private static final Log log
private Cache normCache
private CacheManager cacheManager
private Kernel delegateKernel
private boolean cacheNorm
public NormKernel(Kernel delegateKernel)
public NormKernel()
public boolean isCacheNorm()
public void setCacheNorm(boolean cacheNorm)
public CacheManager getCacheManager()
public void setCacheManager(CacheManager cacheManager)
public Kernel getDelegateKernel()
public void setDelegateKernel(Kernel delegateKernel)
public double getNorm(java.lang.Object o1)
o1
- public double evaluate(java.lang.Object o1, java.lang.Object o2)
public void init()