public class LocalParameterServer extends java.lang.Object implements ParameterServer
LocalParameterServer
is an implementation of the ParameterServer
interface.Constructor and Description |
---|
LocalParameterServer(Optimizer optimizer)
Create a new instance of
LocalParameterServer for the given optimizer. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
init(java.lang.String parameterId,
NDArray[] value)
Initializes the
ParameterStore for the given parameter. |
void |
update(java.lang.String parameterId,
NDArray[] grads,
NDArray[] params)
Updates the parameter of a key from Parameter Server.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
update
public LocalParameterServer(Optimizer optimizer)
LocalParameterServer
for the given optimizer.optimizer
- an optimizerpublic void init(java.lang.String parameterId, NDArray[] value)
ParameterStore
for the given parameter.init
in interface ParameterServer
parameterId
- the parameter IDvalue
- the values to be set for the given parameterpublic void update(java.lang.String parameterId, NDArray[] grads, NDArray[] params)
update
in interface ParameterServer
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.public void close()
close
in interface ParameterServer
close
in interface java.lang.AutoCloseable