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 int
cachedGradientChangeStamp
protected int
cachedValueChangeStamp
protected CRF
crf
-
Constructor Summary
Constructors Constructor Description CRFCacheStaleIndicator(CRF crf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isGradientStale()
Returns true if the gradient is stale, also updates the cacheGradientStamp.boolean
isValueStale()
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:
isValueStale
in interfaceCacheStaleIndicator
-
isGradientStale
public boolean isGradientStale()
Returns true if the gradient is stale, also updates the cacheGradientStamp.- Specified by:
isGradientStale
in interfaceCacheStaleIndicator
-
-