Package ai.djl.training
Class LocalParameterServer
java.lang.Object
ai.djl.training.LocalParameterServer
- All Implemented Interfaces:
ParameterServer,AutoCloseable
LocalParameterServer is an implementation of the ParameterServer interface.-
Constructor Summary
ConstructorsConstructorDescriptionLocalParameterServer(Optimizer optimizer) Create a new instance ofLocalParameterServerfor the given optimizer. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.training.ParameterServer
update
-
Constructor Details
-
LocalParameterServer
Create a new instance ofLocalParameterServerfor the given optimizer.- Parameters:
optimizer- an optimizer
-
-
Method Details
-
init
Initializes theParameterStorefor the given parameter.- Specified by:
initin interfaceParameterServer- Parameters:
parameterId- the parameter IDvalue- the values to be set for the given parameter
-
update
Updates the parameter of a key from Parameter Server.- Specified by:
updatein interfaceParameterServer- Parameters:
parameterId- the key to identify the parametergrads- the gradient NDArrays in different devices to apply the update.params- the parameter NDArrays in different devices to be updated.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceParameterServer
-