public void update() {
   INDArray gradient = null;
   if (commitMethod == 0) {
     gradient = gradientStore.getGradientAvg();
   } else {
     gradient = gradientStore.getGradientSum();
   }
   if (gradient == null) return;
   INDArray gradientL2 = gradient.sub(features.mul(l2));
   if (useAdagrad) {
     getAdagradGradient(gradientL2);
     features.addi(gradientL2.mul(learningRate));
   } else if (useMomentum) {
     getMomentumGradient(gradientL2);
     features.addi(gradientL2.mul(learningRate));
   } else if (useAdadelta) {
     getAdadeltaGradient(gradientL2);
     features.addi(gradientL2);
   } else {
     features.addi(gradientL2.mul(learningRate));
   }
   capValues(GlobalParameters.maxVal);
   featuresT = features.transpose();
   gradientStore.init();
 }
 public void storeInputsAndOutputs(int id, INDArray x, INDArray yGrad) {
   gradientStore.addInputAndOutput(id, x, yGrad);
 }
 public void checkinGradients(int id) {
   gradientStore.computeGradientAndAdd(id);
 }
 public void storeGradients(int processId, INDArray gradient) {
   gradientStore.addGradient(processId, gradient);
 }