Package org.nd4j.parameterserver.updater
Class TimeDelayedParameterUpdater
- java.lang.Object
-
- org.nd4j.parameterserver.updater.BaseParameterUpdater
-
- org.nd4j.parameterserver.updater.TimeDelayedParameterUpdater
-
- All Implemented Interfaces:
ParameterServerUpdater
public class TimeDelayedParameterUpdater extends BaseParameterUpdater
-
-
Field Summary
-
Fields inherited from class org.nd4j.parameterserver.updater.BaseParameterUpdater
ndArrayHolder, updateStorage
-
-
Constructor Summary
Constructors Constructor Description TimeDelayedParameterUpdater()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpartialUpdate(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-
Methods inherited from class org.nd4j.parameterserver.updater.BaseParameterUpdater
isAsync, isReady, ndArrayHolder, numUpdates
-
-
-
-
Method Detail
-
requiredUpdatesForPass
public int requiredUpdatesForPass()
Returns the number of required updates for a new pass- Returns:
- the number of required updates for a new pass
-
status
public Map<String,Number> status()
Returns the current status of this parameter server updater- Returns:
-
toJson
public String toJson()
Serialize this updater as json- Returns:
-
reset
public void reset()
Reset internal counters such as number of updates accumulated.- Specified by:
resetin interfaceParameterServerUpdater- Overrides:
resetin classBaseParameterUpdater
-
shouldReplicate
public 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
public void update(NDArrayMessage message)
Do an update based on the ndarray message.- Parameters:
message-
-
partialUpdate
public 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
public 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
-
-