Interface ParameterServerUpdater

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isAsync()
      Returns true if the given updater is async or synchronous updates
      boolean isReady()
      Returns true if the updater is ready for a new array
      NDArrayHolder ndArrayHolder()
      Get the ndarray holder for this updater
      int numUpdates()
      Num updates passed through the updater
      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...)
      int requiredUpdatesForPass()
      Returns the number of required updates for a new pass
      void reset()
      Reset internal counters such as number of updates accumulated.
      boolean shouldReplicate()
      Returns true if the updater has accumulated enough ndarrays to replicate to the workers
      Map<String,​Number> status()
      Returns the current status of this parameter server updater
      String toJson()
      Serialize this updater as json
      void update​(NDArrayMessage message)
      Do an update based on the ndarray message.
      void update​(org.nd4j.linalg.api.ndarray.INDArray arr, org.nd4j.linalg.api.ndarray.INDArray result)
      Updates result based on arr
    • Method Detail

      • requiredUpdatesForPass

        int requiredUpdatesForPass()
        Returns the number of required updates for a new pass
        Returns:
        the number of required updates for a new pass
      • isReady

        boolean isReady()
        Returns true if the updater is ready for a new array
        Returns:
      • isAsync

        boolean isAsync()
        Returns true if the given updater is async or synchronous updates
        Returns:
        true if the given updater is async or synchronous updates
      • ndArrayHolder

        NDArrayHolder ndArrayHolder()
        Get the ndarray holder for this updater
        Returns:
        the ndarray holder for this updater
      • numUpdates

        int numUpdates()
        Num updates passed through the updater
        Returns:
        the number of updates
      • status

        Map<String,​Number> status()
        Returns the current status of this parameter server updater
        Returns:
      • toJson

        String toJson()
        Serialize this updater as json
        Returns:
      • reset

        void reset()
        Reset internal counters such as number of updates accumulated.
      • shouldReplicate

        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

        void update​(NDArrayMessage message)
        Do an update based on the ndarray message.
        Parameters:
        message -
      • partialUpdate

        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

        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