I\'m trying to implement logistic regression in python, I want to halt the training process at the epoch beyond which the train and test error are not improving. I did the follo