Mercurial > pylearn
diff mlp_factory_approach.py @ 190:aa7a3ecbcc90
progress toward early stopping
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Wed, 14 May 2008 16:24:10 -0400 |
parents | 8f58abb943d4 |
children | e816821c1e50 |
line wrap: on
line diff
--- a/mlp_factory_approach.py Wed May 14 14:50:07 2008 -0400 +++ b/mlp_factory_approach.py Wed May 14 16:24:10 2008 -0400 @@ -1,7 +1,10 @@ -import dataset +import copy +import numpy + import theano import theano.tensor as t -import numpy + +import dataset import nnet_ops def _randshape(*shape): @@ -14,6 +17,9 @@ self.nnet = nnet self.params = params + def __copy__(self): + return _Model(self.nnet, [copy.copy(p) for p in params]) + def update(self, trainset, stopper=None): """Update this model from more training data.""" v = self.nnet.v