Conversation
vfdev-5
left a comment
There was a problem hiding this comment.
Thanks for the PR @Ishan-Kumar2 !
I left few minor comments to address.
| self.trainer = trainer | ||
| self.counter = 0 | ||
| self.best_score = None # type: Optional[float] | ||
| self.logger = setup_logger(__name__ + "." + self.__class__.__name__) |
There was a problem hiding this comment.
We may want also the logger for NoImprovementHandler ?
|
|
||
| """ | ||
|
|
||
| _state_dict_all_req_keys = ( |
There was a problem hiding this comment.
If we want to save NoImprovementHandler's internal state we have to keep _state_dict_all_req_keys, IMO
|
@Ishan-Kumar2 It looks very good, thanks ! Please go ahead with the tests ! |
|
@sdesrozis @vfdev-5 I have added the tests, a lot of them are similar to the EarlyStopping tests and might not be even needed since they both use the NoImprovementHandler functions. For instance, Also, the failing test seems unrelated to this PR |
Yes please, removing redundancy would be great. Let's see on our side to fix unrelated issues before merging. Thanks again and sorry for the late answer. |
|
@sdesrozis I was thinking about the redundancies, while it's true that they both call the same function do you think it is still worth having retaining the |
|
@Ishan-Kumar2 the tests are both useful especially if we consider the evolution of the library. I was thinking about having an unique and generic test code for the both. It would imply introducing an abstraction for the test result. As the tests are quite small and clear, I'm finally not sure about that. So let's keep it simple. I will review asap. Thanks again. |
Fixes #2314
Description:
As described in the issue, added a generalized version of EarlyStopping where the
stop_functionandpass_functioncan be user-defined.@sdesrozis let me know if the approach is correct, I'll start working on the tests.
Check list: