added batch() and batch_save() for training