In Keras, EarlyStopping could judge whether I should stop my training procedure, I am wondering if there is an API could do the same thing in PyTorch, or what method could do the same thing easy to implement?