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 boolean
allowCollapse
protected AtomicLong
collapsedIndex
protected AtomicBoolean
collapsedMode
protected int
collapseThreshold
protected AtomicBoolean
dead
protected int
expectedConsumers
protected AtomicLong
lastDeletedIndex
protected ReentrantReadWriteLock
lock
protected ConcurrentHashMap<Long,AtomicLong>
positions
protected long[]
shape
protected Map<Long,INDArray>
updates
protected AtomicLong
updatesCounter
-
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 boolean
drainTo(long threadId, @NonNull INDArray array)
boolean
drainTo(@NonNull INDArray array)
long
firstNotAppliedIndexEverywhere()
protected long
getDelta()
long
getDelta(long threadId)
protected long
getGlobalPosition()
protected long
getLocalPosition()
protected long
getLocalPosition(long threadId)
boolean
hasAnything()
boolean
hasAnything(long threadId)
boolean
isDead()
void
maintenance()
This method does maintenance of updates withinlong
maxAppliedIndexEverywhere()
void
notifyDead()
void
purge()
void
put(@NonNull INDArray update)
This mehtod adds update, with optional collapseprotected INDArray
smartDecompress(INDArray encoded, @NonNull INDArray target)
int
updatesSize()
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()
-
-