code: public void setMomentum(double momentum)
      {
          if(momentum <= 0 || momentum >= 1 || Double.isNaN(momentum))
              throw new IllegalArgumentException("Momentum must be in (0,1) not " + momentum);
          this.momentum = momentum;
      }
docs: Sets the momentum for accumulating gradients.
  @param momentum the momentum buildup term in (0, 1)