Class NNParams

  • All Implemented Interfaces:
    ml.shifu.guagua.io.Bytable

    public class NNParams
    extends ml.shifu.guagua.io.HaltBytable
    NNParams are used to save NN model info which can also be stored into ZooKeeper.

    weights is used to set model weights which is used to transfer info from master to workers.

    gradients is used to accumulate all workers' gradients together in master and then use the accumulated gradients to update neural network weights.

    • Constructor Detail

      • NNParams

        public NNParams()
    • Method Detail

      • getWeights

        public double[] getWeights()
      • setWeights

        public void setWeights​(double[] weights)
      • getTestError

        public double getTestError()
      • setTestError

        public void setTestError​(double testError)
      • getTrainError

        public double getTrainError()
      • setTrainError

        public void setTrainError​(double trainError)
      • accumulateGradients

        public void accumulateGradients​(double[] gradients)
      • getGradients

        public double[] getGradients()
        Returns:
        the gradients
      • setGradients

        public void setGradients​(double[] gradients)
        Parameters:
        gradients - the gradients to set
      • getTrainSize

        public long getTrainSize()
      • setTrainSize

        public void setTrainSize​(long trainSize)
      • accumulateTrainSize

        public void accumulateTrainSize​(long size)
      • reset

        public void reset()
      • doReadFields

        public void doReadFields​(DataInput in)
                          throws IOException
        Specified by:
        doReadFields in class ml.shifu.guagua.io.HaltBytable
        Throws:
        IOException