Package org.nd4j.parameterserver.updater
Interface ParameterServerUpdater
-
- All Known Implementing Classes:
BaseParameterUpdater,SoftSyncParameterUpdater,SynchronousParameterUpdater,TimeDelayedParameterUpdater
public interface ParameterServerUpdaterA parameter server updater for applying updates on the parameter server- Author:
- Adam Gibson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisAsync()Returns true if the given updater is async or synchronous updatesbooleanisReady()Returns true if the updater is ready for a new arrayNDArrayHolderndArrayHolder()Get the ndarray holder for this updaterintnumUpdates()Num updates passed through the updatervoidpartialUpdate(org.nd4j.linalg.api.ndarray.INDArray arr, org.nd4j.linalg.api.ndarray.INDArray result, long idx, int... dimensions)Updates result based on arr along a particularINDArray#tensorAlongDimension(int, int...)intrequiredUpdatesForPass()Returns the number of required updates for a new passvoidreset()Reset internal counters such as number of updates accumulated.booleanshouldReplicate()Returns true if the updater has accumulated enough ndarrays to replicate to the workersMap<String,Number>status()Returns the current status of this parameter server updaterStringtoJson()Serialize this updater as jsonvoidupdate(NDArrayMessage message)Do an update based on the ndarray message.voidupdate(org.nd4j.linalg.api.ndarray.INDArray arr, org.nd4j.linalg.api.ndarray.INDArray result)Updates result based on arr
-
-
-
Method Detail
-
requiredUpdatesForPass
int requiredUpdatesForPass()
Returns the number of required updates for a new pass- Returns:
- the number of required updates for a new pass
-
isReady
boolean isReady()
Returns true if the updater is ready for a new array- Returns:
-
isAsync
boolean isAsync()
Returns true if the given updater is async or synchronous updates- Returns:
- true if the given updater is async or synchronous updates
-
ndArrayHolder
NDArrayHolder ndArrayHolder()
Get the ndarray holder for this updater- Returns:
- the ndarray holder for this updater
-
numUpdates
int numUpdates()
Num updates passed through the updater- Returns:
- the number of updates
-
status
Map<String,Number> status()
Returns the current status of this parameter server updater- Returns:
-
toJson
String toJson()
Serialize this updater as json- Returns:
-
reset
void reset()
Reset internal counters such as number of updates accumulated.
-
shouldReplicate
boolean shouldReplicate()
Returns true if the updater has accumulated enough ndarrays to replicate to the workers- Returns:
- true if replication should happen,false otherwise
-
update
void update(NDArrayMessage message)
Do an update based on the ndarray message.- Parameters:
message-
-
partialUpdate
void partialUpdate(org.nd4j.linalg.api.ndarray.INDArray arr, org.nd4j.linalg.api.ndarray.INDArray result, long idx, int... dimensions)Updates result based on arr along a particularINDArray#tensorAlongDimension(int, int...)- Parameters:
arr- the array to updateresult- the result ndarray to updateidx- the index to updatedimensions- the dimensions to update
-
update
void update(org.nd4j.linalg.api.ndarray.INDArray arr, org.nd4j.linalg.api.ndarray.INDArray result)Updates result based on arr- Parameters:
arr- the array to updateresult- the result ndarray to update
-
-