Parameterize size of mini-batches so that distributed learning and weights aggregating phases can be optimized.