def trainOnBatch(self, train_model, i, batch_size, num_train_batches, num_train_samples, learning_rate):
        ngram_start_id = i * batch_size
        ngram_end_id = (i + 1) * batch_size if i < (num_train_batches - 1) else num_train_samples
        outputs = train_model(ngram_start_id, ngram_end_id, learning_rate)
        return outputs
dataset/ETHPy150Open yuhaozhang/nnjm-global/code/train_nnjm.py/TrainNNJMModel.trainOnBatch/original