diff sandbox/rbm/parameters.py @ 406:c2e6a8fcc35e

Globals are now parameters for the RBM model
author Joseph Turian <turian@gmail.com>
date Thu, 10 Jul 2008 02:10:23 -0400
parents e0c9357456e0
children
line wrap: on
line diff
--- a/sandbox/rbm/parameters.py	Thu Jul 10 01:17:40 2008 -0400
+++ b/sandbox/rbm/parameters.py	Thu Jul 10 02:10:23 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.
+        according to the given random_seed. If False, then just use zeroes.
         """
         if randomly_initialize:
-            numpy.random.seed(seed)
+            numpy.random.random_seed(random_seed)
             self.w = (numpy.random.rand(input_dimension, hidden_dimension)-0.5)/input_dimension
             self.b = numpy.zeros((1, hidden_dimension))
             self.c = numpy.zeros((1, input_dimension))