Mercurial > pylearn
diff stopper.py @ 474:40c8a46b3da7
added Stopper.find_min
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Thu, 23 Oct 2008 18:05:46 -0400 |
parents | cc96f93a7810 |
children | 0ea793361d85 |
line wrap: on
line diff
--- a/stopper.py Thu Oct 23 18:05:09 2008 -0400 +++ b/stopper.py Thu Oct 23 18:05:46 2008 -0400 @@ -47,6 +47,17 @@ best = save() return best + def find_min(self, step, check, save): + best = None + for stp in self: + step() + if stp.set_score: + stp.score = check() + if (stp.score < stp.best_score) and save: + best = save() + return best + + class ICML08Stopper(Stopper): @staticmethod