modify the train process of model