Skip to content

Commit 682ef24

Browse files
author
huergasi
committed
float32 for operations v2
1 parent b9f0b64 commit 682ef24

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

scripts/rnn.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,39 @@ def __init__(self, n_inputs, n_hidden, n_output,
3131
self.theta1 = theano.shared(name='theta1',
3232
value=0.2 * np.random.uniform(-1.0, 1.0,
3333
(n_inputs, n_hidden))
34-
.astype(theano.config.float32))
34+
.astype(theano.config.floatX))
3535

3636
# thetah, recurrent weights matrix (hidden to hidden)
3737
self.thetah1 = theano.shared(name='thetah1',
3838
value=0.2 * np.random.uniform(-1.0, 1.0,
3939
(n_hidden, n_hidden))
40-
.astype(theano.config.float32))
40+
.astype(theano.config.floatX))
4141

4242
self.thetah2 = theano.shared(name='thetah2',
4343
value=0.2 * np.random.uniform(-1.0, 1.0,
4444
(n_hidden, n_hidden))
45-
.astype(theano.config.float32))
45+
.astype(theano.config.floatX))
4646

4747
# theta2, weight matrix from hiddent to output units
4848
self.theta2 = theano.shared(name='theta2',
4949
value=0.2 * np.random.uniform(-1.0, 1.0,
5050
(n_hidden, n_output))
51-
.astype(theano.config.float32))
51+
.astype(theano.config.floatX))
5252

5353
# bh, bias vector for hidden units
5454
self.bh = theano.shared(name='bh',
5555
value=np.zeros(n_hidden,
56-
dtype=theano.config.float32))
56+
dtype=theano.config.floatX))
5757

5858
# bout, bias vector for output units
5959
self.bout = theano.shared(name='bout',
6060
value=np.zeros(n_output,
61-
dtype=theano.config.float32))
61+
dtype=theano.config.floatX))
6262

6363
# h0, hidden states
6464
self.h0 = theano.shared(name='h0',
6565
value=np.zeros((2,n_hidden),
66-
dtype=theano.config.float32))
66+
dtype=theano.config.floatX))
6767

6868
# all the parameters
6969
self.params = [self.theta1, self.thetah1, self.thetah2,

0 commit comments

Comments
 (0)