comparison learner.py @ 14:5ede27026e05

Working on gradient_based_learner
author bengioy@bengiomac.local
date Wed, 26 Mar 2008 22:56:13 -0400
parents 633453635d51
children 266c68cb6136
comparison
equal deleted inserted replaced
13:633453635d51 14:5ede27026e05
21 learner has a random number generator that is set to use a 21 learner has a random number generator that is set to use a
22 different seed each time it forget() is called. 22 different seed each time it forget() is called.
23 """ 23 """
24 raise NotImplementedError 24 raise NotImplementedError
25 25
26 def update(self,training_set): 26 def update(self,training_set,train_stats_collector=None):
27 """ 27 """
28 Continue training a learner, with the evidence provided by the given training set. 28 Continue training a learner, with the evidence provided by the given training set.
29 Hence update can be called multiple times. This is particularly useful in the 29 Hence update can be called multiple times. This is particularly useful in the
30 on-line setting or the sequential (Bayesian or not) settings. 30 on-line setting or the sequential (Bayesian or not) settings.
31 The result is a function that can be applied on data, with the same 31 The result is a function that can be applied on data, with the same
32 semantics of the Learner.use method. 32 semantics of the Learner.use method.
33 The user may optionally provide a training StatsCollector that is used to record
34 some statistics of the outputs computed during training.
33 """ 35 """
34 return self.use # default behavior is 'non-adaptive', i.e. update does not do anything 36 return self.use # default behavior is 'non-adaptive', i.e. update does not do anything
35 37
36 38
37 def __call__(self,training_set): 39 def __call__(self,training_set):