Class SynchronousParameterUpdater

    • Constructor Detail

      • SynchronousParameterUpdater

        public SynchronousParameterUpdater​(UpdateStorage updateStorage,
                                           NDArrayHolder ndArrayHolder,
                                           int workers)
        Parameters:
        updateStorage -
        ndArrayHolder -
        workers -
      • SynchronousParameterUpdater

        public SynchronousParameterUpdater​(UpdateStorage updateStorage,
                                           int workers)
        Initialize this updater with a custom update storage
        Parameters:
        updateStorage - the update storage to use
      • SynchronousParameterUpdater

        public SynchronousParameterUpdater​(int workers)
        Initializes this updater with InMemoryUpdateStorage
    • 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
      • isAsync

        public boolean isAsync()
        Returns true if the given updater is async or synchronous updates
        Specified by:
        isAsync in interface ParameterServerUpdater
        Overrides:
        isAsync in class BaseParameterUpdater
        Returns:
        true if the given updater is async or synchronous updates
      • 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:
      • 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 particular INDArray#tensorAlongDimension(int, int...)
        Parameters:
        arr - the array to update
        result - the result ndarray to update
        idx - the index to update
        dimensions - 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 update
        result - the result ndarray to update