Improving the convergence of SGD through adaptive batch sizes