File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ particular word. In details, we have::
132
132
assert win >=1
133
133
l = list(l)
134
134
135
- lpadded = win/2 * [-1] + l + win/2 * [-1]
135
+ lpadded = win// 2 * [-1] + l + win/ /2 * [-1]
136
136
out = [ lpadded[i:i+win] for i in range(len(l)) ]
137
137
138
138
assert len(out) == len(l)
@@ -177,7 +177,7 @@ Using Theano, it gives::
177
177
embeddings = theano.shared(0.2 * numpy.random.uniform(-1.0, 1.0, \
178
178
(nv+1, de)).astype(theano.config.floatX)) # add one for PADDING at the end
179
179
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
181
181
x, _ = theano.scan(fn = lambda idx: embeddings[idx].flatten(), sequences = idxs)
182
182
183
183
The x symbolic variable corresponds to a matrix of shape (number of words in the
You can’t perform that action at this time.
0 commit comments