@@ -126,7 +126,7 @@ Context window
126
126
127
127
Given a sentence i.e. an array of indexes, and a window size i.e. 1,3,5,..., we
128
128
need to convert each word in the sentence to a context window surrounding this
129
- particular word. In details, we have::
129
+ particular word. In details, we have:
130
130
131
131
.. literalinclude:: ../code/rnnslu.py
132
132
:start-after: start-snippet-1
@@ -235,37 +235,37 @@ The **hyperparameters** define the whole architecture:
235
235
* number of classes
236
236
* random seed + way to initialize the model
237
237
238
- It gives the following code::
238
+ It gives the following code:
239
239
240
240
.. literalinclude:: ../code/rnnslu.py
241
241
:start-after: start-snippet-2
242
242
:end-before: end-snippet-2
243
243
244
- Then we integrate the way to build the input from the embedding matrix::
244
+ Then we integrate the way to build the input from the embedding matrix:
245
245
246
246
.. literalinclude:: ../code/rnnslu.py
247
247
:start-after: start-snippet-3
248
248
:end-before: end-snippet-3
249
249
250
- We use the scan operator to construct the recursion, works like a charm::
250
+ We use the scan operator to construct the recursion, works like a charm:
251
251
252
252
.. literalinclude:: ../code/rnnslu.py
253
253
:start-after: start-snippet-4
254
254
:end-before: end-snippet-4
255
255
256
- Theano will then compute all the gradients automatically to maximize the log-likelihood::
256
+ Theano will then compute all the gradients automatically to maximize the log-likelihood:
257
257
258
258
.. literalinclude:: ../code/rnnslu.py
259
259
:start-after: start-snippet-5
260
260
:end-before: end-snippet-5
261
261
262
- Next compile those functions::
262
+ Next compile those functions:
263
263
264
264
.. literalinclude:: ../code/rnnslu.py
265
265
:start-after: start-snippet-6
266
266
:end-before: end-snippet-6
267
267
268
- We keep the word embeddings on the unit sphere by normalizing them after each update::
268
+ We keep the word embeddings on the unit sphere by normalizing them after each update:
269
269
270
270
.. literalinclude:: ../code/rnnslu.py
271
271
:start-after: start-snippet-7
0 commit comments