Skip to content

Commit f9c425b

Browse files
author
Grégoire
committed
review fix
1 parent b7c8d04 commit f9c425b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/rnnslu.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,14 @@ Using Theano, it gives::
172172

173173
# nv :: size of our vocabulary
174174
# de :: dimension of the embedding space
175-
nv, de = 1000, 50
175+
# cs :: context window size
176+
nv, de, cs = 1000, 50, 5
176177

177178
embeddings = theano.shared(0.2 * numpy.random.uniform(-1.0, 1.0, \
178179
(nv+1, de)).astype(theano.config.floatX)) # add one for PADDING at the end
179180

180181
idxs = T.imatrix() # as many columns as words in the context window and as many lines as words in the sentence
181-
x, _ = theano.scan(fn=lambda idx: embeddings[idx].flatten(), sequences=idxs)
182+
x = self.emb[idxs].reshape((idxs.shape[0], de*cs))
182183

183184
The x symbolic variable corresponds to a matrix of shape (number of words in the
184185
sentences, dimension of the embedding space X context window size).

0 commit comments

Comments
 (0)