comparison code_tutoriel/mlp.py @ 20:1e9525aba832

merge
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Thu, 28 Jan 2010 14:54:28 -0500
parents 827de2cc34f8
children 4bc5eeec6394
comparison
equal deleted inserted replaced
19:db10ee2a07fb 20:1e9525aba832
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,),