Class BasicGradientsAccumulator

    • Constructor Detail

      • BasicGradientsAccumulator

        public BasicGradientsAccumulator​(int parties)
        Creates new GradientsAccumulator with starting threshold of 1e-3
      • BasicGradientsAccumulator

        public BasicGradientsAccumulator​(int parties,
                                         @NonNull
                                         @NonNull MessageHandler handler)
        Creates new GradientsAccumulator with custom starting threshold
        Parameters:
        handler - MessageHandler instance that'll be used for communication purposes
    • Method Detail

      • storeUpdate

        public void storeUpdate​(INDArray array,
                                int iterationNumber,
                                int epochNumber)
        This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workers
        Specified by:
        storeUpdate in interface GradientsAccumulator
        Parameters:
        array -
      • receiveUpdate

        public void receiveUpdate​(INDArray array)
        This method accepts updates suitable for StepFunction and puts them to the queue, which is used in backpropagation loop PLEASE NOTE: array is expected to be ready for use and match params dimensionality
        Specified by:
        receiveUpdate in interface GradientsAccumulator
        Parameters:
        array -
      • reset

        public void reset()
        This method resets all accumulated updates (if any)
        Specified by:
        reset in interface GradientsAccumulator
      • touch

        public void touch()
        This method does initialization of given worker wrt Thread-Device Affinity
        Specified by:
        touch in interface GradientsAccumulator
      • setExternalSource

        public void setExternalSource​(IndexedTail source)
        Description copied from interface: GradientsAccumulator
        This method allows to pass external updates to accumulator, they will be populated across all workers using this GradientsAccumulator instance
        Specified by:
        setExternalSource in interface GradientsAccumulator