public class ParameterStore
extends java.lang.Object
ParameterStore contains a map from a parameter to the mirrors of it on other devices.| Constructor and Description |
|---|
ParameterStore()
Constructs a new
ParameterStore instance. |
ParameterStore(NDManager manager,
boolean copy)
Constructs an empty
ParameterStore. |
| Modifier and Type | Method and Description |
|---|---|
NDManager |
getManager()
Get the
NDManager associated with ParameterStore. |
NDArray |
getValue(Parameter parameter,
Device device,
boolean training)
Returns the value of a mirrored parameter on a device.
|
void |
setParameterServer(ParameterServer parameterServer,
Device[] devices)
Sets the parameterServer used to apply updates to the parameters.
|
void |
sync()
Synchronizes the values on all mirrors with the main parameter.
|
void |
updateAllParameters()
Updates all the mirrored parameters.
|
public ParameterStore()
ParameterStore instance.public ParameterStore(NDManager manager, boolean copy)
ParameterStore.manager - the manager to attach mirrored parameters tocopy - whether to always copy even for the same device as the original parameterpublic void setParameterServer(ParameterServer parameterServer, Device[] devices)
parameterServer - the parameterServerdevices - the devices to create mirrored parameters onpublic void updateAllParameters()
public NDArray getValue(Parameter parameter, Device device, boolean training)
parameter - the parameter to get the value fordevice - the device to get the mirror fromtraining - true for a training forward passpublic NDManager getManager()
NDManager associated with ParameterStore.NDManagerpublic void sync()