You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/rnnrbm.txt
+40-24Lines changed: 40 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,11 @@ Modeling and generating sequences of polyphonic music with the RNN-RBM
17
17
The script also assumes that the content of the `Nottingham Database of folk tunes <http://www-etud.iro.umontreal.ca/~boulanni/Nottingham.zip>`_ has been extracted in the working directory.
18
18
Alternative MIDI datasets are available `here <http://www-etud.iro.umontreal.ca/~boulanni/icml2012>`_.
19
19
20
+
.. caution::
21
+
Depending on your locally installed Theano version, you may have problems running this script.
22
+
If this is the case, please use the 'bleeding-edge' developer version from github and checkout the 0.6rc1 release:
We ran the code on the Nottingham database for 150 epochs; training took approximately 48 hours.
309
+
We ran the code on the Nottingham database for 200 epochs; training took approximately 24 hours.
304
310
305
311
The output was the following:
306
312
307
313
.. code-block:: text
308
314
309
-
Epoch 1/150 -15.0308940028
310
-
Epoch 2/150 -10.4892606673
311
-
Epoch 3/150 -10.2394696138
312
-
Epoch 4/150 -10.1431669994
313
-
Epoch 5/150 -9.7005382843
314
-
Epoch 6/150 -8.5985647524
315
-
Epoch 7/150 -8.35115428534
316
-
Epoch 8/150 -8.26453580552
317
-
Epoch 9/150 -8.21208991542
318
-
Epoch 10/150 -8.16847274143
319
-
Epoch 11/150 -8.03408036522
320
-
Epoch 12/150 -7.72139097234
321
-
Epoch 13/150 -7.56626080635
315
+
Epoch 1/150 -15.0154373583
316
+
Epoch 2/150 -10.4948703701
317
+
Epoch 3/150 -10.2507567848
318
+
Epoch 4/150 -10.1417621708
319
+
Epoch 5/150 -9.69403756276
320
+
Epoch 6/150 -8.6036962785
321
+
Epoch 7/150 -8.35180803953
322
+
Epoch 8/150 -8.26202621624
323
+
Epoch 9/150 -8.21526214665
324
+
Epoch 10/150 -8.16552397791
325
+
326
+
... truncated for brevity ...
322
327
323
-
... truncated for brevity ...
328
+
Epoch 140/150 -5.09668220315
329
+
Epoch 141/150 -5.08657006002
330
+
Epoch 142/150 -5.09776776338
331
+
Epoch 143/150 -5.10151042486
332
+
Epoch 144/150 -5.07677377181
333
+
Epoch 145/150 -5.07374453388
334
+
Epoch 146/150 -inf
335
+
Epoch 147/150 -5.06393939067
336
+
Epoch 148/150 -5.07493685431
337
+
Epoch 149/150 -5.06504525246
338
+
Epoch 150/150 -5.04567771601
324
339
325
-
Epoch ..
326
340
327
341
328
-
The figures below show the piano-roll of two sample sequences and the corresponding MIDI files are provided:
342
+
The figures below show the piano-rolls of two sample sequences and we provide the corresponding MIDI files:
329
343
330
-
.. figure:: images/rnnrbm.png
344
+
.. figure:: images/sample1.png
345
+
:scale: 60%
331
346
332
-
`sample1.mid <sample1.mid>`_
347
+
Listen to `sample1.mid <http://www-etud.iro.umontreal.ca/~boulanni/sample1.mid>`_
333
348
334
-
.. figure:: images/rnnrbm.png
349
+
.. figure:: images/sample1.png
350
+
:scale: 60%
335
351
336
-
`sample2.mid <sample2.mid>`_
352
+
Listen to `sample2.mid <http://www-etud.iro.umontreal.ca/~boulanni/sample2.mid>`_
337
353
338
354
339
355
How to improve this code
@@ -343,7 +359,7 @@ The code shown in this tutorial is a stripped-down version that can be improved
343
359
344
360
* Pretraining techniques: initialize the :math:`W,b_v,b_h` parameters with independent RBMs with fully shuffled frames (i.e. :math:`W_{uh}=W_{uv}=W_{uu}=W_{vu}=0`); initialize the :math:`W_{uv},W_{uu},W_{vu},b_u` parameters of the RNN with the auxiliary cross-entropy objective via either SGD or, preferably, Hessian-free optimization [BoulangerLewandowski12]_.
345
361
* Optimization techniques: gradient clipping, Nesterov momentum and the use of NADE for conditional density estimation.
346
-
* Preprocessing: transposing the sequences in common tonality (e.g. C major / minor) and normalizing the tempo in beats (quarternotes) per minute can yield important improvement in the generative quality of the model.
362
+
* Preprocessing: transposing the sequences in a common tonality (e.g. C major / minor) and normalizing the tempo in beats (quarternotes) per minute can yield substantial improvement in the generative quality of the model.
347
363
* Hyperparameter search: learning rate (separately for the RBM and RNN parts), learning rate schedules, batch size, number of hidden units (recurrent and RBM), momentum coefficient, momentum schedule, Gibbs chain length :math:`k` and early stopping.
348
364
* Learn the initial condition :math:`u^{(0)}` as a model parameter.
0 commit comments