changeset 474:40c8a46b3da7

added Stopper.find_min
author James Bergstra <bergstrj@iro.umontreal.ca>
date Thu, 23 Oct 2008 18:05:46 -0400
parents 31acd42b2b0b
children 11e0357f06f4
files stopper.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
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