rename trainAll to trainBatch