Package cc.mallet.fst
Class CRFCacheStaleIndicator
- java.lang.Object
-
- cc.mallet.fst.CRFCacheStaleIndicator
-
- All Implemented Interfaces:
CacheStaleIndicator
public class CRFCacheStaleIndicator extends java.lang.Object implements CacheStaleIndicator
Indicates when the value/gradient becomes stale based on updates to CRF's parameters.- Author:
- Gaurav Chandalia
-
-
Field Summary
Fields Modifier and Type Field Description protected intcachedGradientChangeStampprotected intcachedValueChangeStampprotected CRFcrf
-
Constructor Summary
Constructors Constructor Description CRFCacheStaleIndicator(CRF crf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisGradientStale()Returns true if the gradient is stale, also updates the cacheGradientStamp.booleanisValueStale()Returns true if the value is stale, also updates the cacheValueStamp.
-
-
-
Field Detail
-
crf
protected CRF crf
-
cachedValueChangeStamp
protected int cachedValueChangeStamp
-
cachedGradientChangeStamp
protected int cachedGradientChangeStamp
-
-
Constructor Detail
-
CRFCacheStaleIndicator
public CRFCacheStaleIndicator(CRF crf)
-
-
Method Detail
-
isValueStale
public boolean isValueStale()
Returns true if the value is stale, also updates the cacheValueStamp.- Specified by:
isValueStalein interfaceCacheStaleIndicator
-
isGradientStale
public boolean isGradientStale()
Returns true if the gradient is stale, also updates the cacheGradientStamp.- Specified by:
isGradientStalein interfaceCacheStaleIndicator
-
-