Ensure equal batch sizes in MBSGD.