Mercurial > ift6266
comparison code_tutoriel/mlp.py @ 18:827de2cc34f8
Error on the sign of the lower bound of the initialization of W2
author | Owner <salahmeister@gmail.com> |
---|---|
date | Thu, 28 Jan 2010 13:29:07 -0600 |
parents | bcc87d3e33a3 |
children | 4bc5eeec6394 |
comparison
equal
deleted
inserted
replaced
17:c91d9f70206d | 18:827de2cc34f8 |
---|---|
81 # `W2` is initialized with `W2_values` which is uniformely sampled | 81 # `W2` is initialized with `W2_values` which is uniformely sampled |
82 # from -6./sqrt(n_hidden+n_out) and 6./sqrt(n_hidden+n_out) | 82 # from -6./sqrt(n_hidden+n_out) and 6./sqrt(n_hidden+n_out) |
83 # the output of uniform if converted using asarray to dtype | 83 # the output of uniform if converted using asarray to dtype |
84 # theano.config.floatX so that the code is runable on GPU | 84 # theano.config.floatX so that the code is runable on GPU |
85 W2_values = numpy.asarray( numpy.random.uniform( | 85 W2_values = numpy.asarray( numpy.random.uniform( |
86 low = numpy.sqrt(6./(n_hidden+n_out)), \ | 86 low = -numpy.sqrt(6./(n_hidden+n_out)), \ |
87 high= numpy.sqrt(6./(n_hidden+n_out)),\ | 87 high= numpy.sqrt(6./(n_hidden+n_out)),\ |
88 size= (n_hidden, n_out)), dtype = theano.config.floatX) | 88 size= (n_hidden, n_out)), dtype = theano.config.floatX) |
89 | 89 |
90 self.W1 = theano.shared( value = W1_values ) | 90 self.W1 = theano.shared( value = W1_values ) |
91 self.b1 = theano.shared( value = numpy.zeros((n_hidden,), | 91 self.b1 = theano.shared( value = numpy.zeros((n_hidden,), |