Closed yjlolo closed 5 years ago
Thanks for your contribution, I have learned a lot from the template. I think it would be good to have early stop in base_trainer.py.
base_trainer.py
something like
def __init__(): self.no_improve_count = 0 if self.config['trainer']['early_stop'] else None def train() if self.no_improve_count: self.no_improve_count += 1 if self.no_improve_count == self.early_stop: msg = "Metric named '{}' ".format(self.monitor)\ + "has not improved for {} epochs; stop training".format(self.early_stop) self.logger.info(msg) break
I think this is a good idea. I will try to implement this feature in my local repository, but it may take some time to do so.
I added this feature in PR #34. Would you test the early_stop option, @yjlolo?
Thanks for your contribution, I have learned a lot from the template. I think it would be good to have early stop in
base_trainer.py
.something like