Package org.nd4j.parameterserver
Class ParameterServerListener
- java.lang.Object
-
- org.nd4j.parameterserver.ParameterServerListener
-
- All Implemented Interfaces:
NDArrayCallback
public class ParameterServerListener extends Object implements NDArrayCallback
-
-
Constructor Summary
Constructors Constructor Description ParameterServerListener(int[] shape)Shape of the ndarrayParameterServerListener(int[] shape, int updatesPerEpoch)Shape of the ndarrayParameterServerListener(int[] shape, ParameterServerUpdater updater)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinish()Do a final divide for averagingvoidonNDArray(org.nd4j.linalg.api.ndarray.INDArray arr)Setup an ndarrayvoidonNDArrayMessage(NDArrayMessage message)A listener for ndarray messagevoidonNDArrayPartial(org.nd4j.linalg.api.ndarray.INDArray arr, long idx, int... dimensions)Used for partial updates using tensor along dimension
-
-
-
Constructor Detail
-
ParameterServerListener
public ParameterServerListener(int[] shape, int updatesPerEpoch)Shape of the ndarray- Parameters:
shape- the shape of the arrayupdatesPerEpoch- the number of updates per epoch for synchronization
-
ParameterServerListener
public ParameterServerListener(int[] shape)
Shape of the ndarray- Parameters:
shape- the shape of the array
-
ParameterServerListener
public ParameterServerListener(int[] shape, ParameterServerUpdater updater)- Parameters:
shape- the shape of the arrayupdater- the updater to use for this server
-
-
Method Detail
-
onNDArrayMessage
public void onNDArrayMessage(NDArrayMessage message)
A listener for ndarray message- Specified by:
onNDArrayMessagein interfaceNDArrayCallback- Parameters:
message- the message for the callback
-
onNDArrayPartial
public void onNDArrayPartial(org.nd4j.linalg.api.ndarray.INDArray arr, long idx, int... dimensions)Used for partial updates using tensor along dimension- Specified by:
onNDArrayPartialin interfaceNDArrayCallback- Parameters:
arr- the array to count as an updateidx- the index for the tensor along dimensiondimensions- the dimensions to act on for the tensor along dimension
-
onNDArray
public void onNDArray(org.nd4j.linalg.api.ndarray.INDArray arr)
Setup an ndarray- Specified by:
onNDArrayin interfaceNDArrayCallback- Parameters:
arr-
-
finish
public void finish()
Do a final divide for averaging
-
-