comparison 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
comparison
equal deleted inserted replaced
473:31acd42b2b0b 474:40c8a46b3da7
44 if stp.set_score: 44 if stp.set_score:
45 stp.score = validate() 45 stp.score = validate()
46 if (stp.score < stp.best_score) and save: 46 if (stp.score < stp.best_score) and save:
47 best = save() 47 best = save()
48 return best 48 return best
49
50 def find_min(self, step, check, save):
51 best = None
52 for stp in self:
53 step()
54 if stp.set_score:
55 stp.score = check()
56 if (stp.score < stp.best_score) and save:
57 best = save()
58 return best
59
49 60
50 61
51 class ICML08Stopper(Stopper): 62 class ICML08Stopper(Stopper):
52 @staticmethod 63 @staticmethod
53 def icml08(ntrain, batchsize): 64 def icml08(ntrain, batchsize):