Added a batch mode for the training data generator