Interface GradientsAccumulator
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BasicGradientsAccumulator
,EncodedGradientsAccumulator
public interface GradientsAccumulator extends Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
applyUpdate(StepFunction function, INDArray params, INDArray updates, boolean isFinalStep)
This method applies accumulated updates via given StepFunctionvoid
applyUpdate(StepFunction function, INDArray params, INDArray updates, double alpha)
This method applies accumulated updates via given StepFunctionIndexedTail
getExternalSource()
boolean
hasAnything()
This method checks if there are any (probably external) updates availablevoid
markExternalUpdates(boolean updatesAvailable)
This method allows to highlight early availability of updatesvoid
receiveUpdate(INDArray array)
This method accepts updates suitable for StepFunction and puts them to the queue, which is used in backpropagation loop PLEASE NOTE: array is expected to be ready for use and match params dimensionalityvoid
reset()
This method resets all accumulated updates (if any)void
setExternalSource(IndexedTail source)
This method allows to pass external updates to accumulator, they will be populated across all workers using this GradientsAccumulator instancevoid
storeUpdate(INDArray array, int iterationNumber, int epochNumber)
This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workersvoid
touch()
This method does initialization of given worker wrt Thread-Device Affinity
-
-
-
Method Detail
-
setExternalSource
void setExternalSource(IndexedTail source)
This method allows to pass external updates to accumulator, they will be populated across all workers using this GradientsAccumulator instance- Parameters:
source
-
-
getExternalSource
IndexedTail getExternalSource()
-
applyUpdate
void applyUpdate(StepFunction function, INDArray params, INDArray updates, boolean isFinalStep)
This method applies accumulated updates via given StepFunction- Parameters:
function
-params
-
-
applyUpdate
void applyUpdate(StepFunction function, INDArray params, INDArray updates, double alpha)
This method applies accumulated updates via given StepFunction- Parameters:
function
-params
-
-
storeUpdate
void storeUpdate(INDArray array, int iterationNumber, int epochNumber)
This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workers- Parameters:
array
-
-
receiveUpdate
void receiveUpdate(INDArray array)
This method accepts updates suitable for StepFunction and puts them to the queue, which is used in backpropagation loop PLEASE NOTE: array is expected to be ready for use and match params dimensionality- Parameters:
array
-
-
markExternalUpdates
void markExternalUpdates(boolean updatesAvailable)
This method allows to highlight early availability of updates- Parameters:
updatesAvailable
-
-
reset
void reset()
This method resets all accumulated updates (if any)
-
touch
void touch()
This method does initialization of given worker wrt Thread-Device Affinity
-
hasAnything
boolean hasAnything()
This method checks if there are any (probably external) updates available- Returns:
-
-