Skip to content

Commit c0ab16e

Browse files
author
Grégoire
committed
precise the idxs dimensions
1 parent 827c291 commit c0ab16e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/rnnslu.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ particular word. In details, we have::
132132
assert win >=1
133133
l = list(l)
134134

135-
lpadded = win/2 * [-1] + l + win/2 * [-1]
135+
lpadded = win//2 * [-1] + l + win//2 * [-1]
136136
out = [ lpadded[i:i+win] for i in range(len(l)) ]
137137

138138
assert len(out) == len(l)
@@ -177,7 +177,7 @@ Using Theano, it gives::
177177
embeddings = theano.shared(0.2 * numpy.random.uniform(-1.0, 1.0, \
178178
(nv+1, de)).astype(theano.config.floatX)) # add one for PADDING at the end
179179

180-
idxs = T.imatrix() # as many columns as context window size/lines as words in the sentence
180+
idxs = T.imatrix() # as many columns as words in the context window and as many lines as words in the sentence
181181
x, _ = theano.scan(fn = lambda idx: embeddings[idx].flatten(), sequences = idxs)
182182

183183
The x symbolic variable corresponds to a matrix of shape (number of words in the

0 commit comments

Comments
 (0)