Mercurial > pylearn
diff sandbox/simple_autoassociator/parameters.py @ 417:4f61201fa9a9
Parameters are no longer global
author | Joseph Turian <turian@iro.umontreal.ca> |
---|---|
date | Fri, 11 Jul 2008 17:19:37 -0400 |
parents | faffaae0d2f9 |
children |
line wrap: on
line diff
--- a/sandbox/simple_autoassociator/parameters.py Fri Jul 11 16:34:46 2008 -0400 +++ b/sandbox/simple_autoassociator/parameters.py Fri Jul 11 17:19:37 2008 -0400 @@ -3,20 +3,19 @@ """ import numpy -import globals class Parameters: """ Parameters used by the L{Model}. """ - def __init__(self, input_dimension=globals.INPUT_DIMENSION, hidden_dimension=globals.HIDDEN_DIMENSION, randomly_initialize=False, seed=globals.SEED): + def __init__(self, input_dimension, hidden_dimension, randomly_initialize, random_seed): """ Initialize L{Model} parameters. @param randomly_initialize: If True, then randomly initialize according to the given seed. If False, then just use zeroes. """ if randomly_initialize: - numpy.random.seed(seed) + numpy.random.seed(random_seed) self.w1 = (numpy.random.rand(input_dimension, hidden_dimension)-0.5)/input_dimension self.w2 = (numpy.random.rand(hidden_dimension, input_dimension)-0.5)/hidden_dimension self.b1 = numpy.zeros(hidden_dimension)