Class IndexedTail
- java.lang.Object
-
- org.deeplearning4j.optimize.solvers.accumulation.IndexedTail
-
public class IndexedTail extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowCollapseprotected AtomicLongcollapsedIndexprotected AtomicBooleancollapsedModeprotected intcollapseThresholdprotected AtomicBooleandeadprotected intexpectedConsumersprotected AtomicLonglastDeletedIndexprotected ReentrantReadWriteLocklockprotected ConcurrentHashMap<Long,AtomicLong>positionsprotected long[]shapeprotected Map<Long,INDArray>updatesprotected AtomicLongupdatesCounter
-
Constructor Summary
Constructors Constructor Description IndexedTail(int expectedConsumers)IndexedTail(int expectedConsumers, boolean allowCollapse, long[] shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandrainTo(long threadId, @NonNull INDArray array)booleandrainTo(@NonNull INDArray array)longfirstNotAppliedIndexEverywhere()protected longgetDelta()longgetDelta(long threadId)protected longgetGlobalPosition()protected longgetLocalPosition()protected longgetLocalPosition(long threadId)booleanhasAnything()booleanhasAnything(long threadId)booleanisDead()voidmaintenance()This method does maintenance of updates withinlongmaxAppliedIndexEverywhere()voidnotifyDead()voidpurge()voidput(@NonNull INDArray update)This mehtod adds update, with optional collapseprotected INDArraysmartDecompress(INDArray encoded, @NonNull INDArray target)intupdatesSize()This method returns actual number of updates stored within tail
-
-
-
Field Detail
-
positions
protected ConcurrentHashMap<Long,AtomicLong> positions
-
updatesCounter
protected AtomicLong updatesCounter
-
lastDeletedIndex
protected AtomicLong lastDeletedIndex
-
expectedConsumers
protected final int expectedConsumers
-
dead
protected AtomicBoolean dead
-
lock
protected ReentrantReadWriteLock lock
-
allowCollapse
protected final boolean allowCollapse
-
shape
protected final long[] shape
-
collapseThreshold
protected final int collapseThreshold
- See Also:
- Constant Field Values
-
collapsedMode
protected AtomicBoolean collapsedMode
-
collapsedIndex
protected AtomicLong collapsedIndex
-
-
Method Detail
-
put
public void put(@NonNull @NonNull INDArray update)This mehtod adds update, with optional collapse- Parameters:
update-
-
firstNotAppliedIndexEverywhere
public long firstNotAppliedIndexEverywhere()
-
maxAppliedIndexEverywhere
public long maxAppliedIndexEverywhere()
-
hasAnything
public boolean hasAnything()
-
hasAnything
public boolean hasAnything(long threadId)
- Returns:
-
drainTo
public boolean drainTo(@NonNull @NonNull INDArray array)
-
getGlobalPosition
protected long getGlobalPosition()
-
getLocalPosition
protected long getLocalPosition()
-
getDelta
protected long getDelta()
-
getDelta
public long getDelta(long threadId)
-
getLocalPosition
protected long getLocalPosition(long threadId)
-
drainTo
public boolean drainTo(long threadId, @NonNull @NonNull INDArray array)
-
maintenance
public void maintenance()
This method does maintenance of updates within
-
updatesSize
public int updatesSize()
This method returns actual number of updates stored within tail- Returns:
-
smartDecompress
protected INDArray smartDecompress(INDArray encoded, @NonNull @NonNull INDArray target)
-
isDead
public boolean isDead()
-
notifyDead
public void notifyDead()
-
purge
public void purge()
-
-