GeezerVison is showing github.com — Add the new rnnrbm tutorial in the normal test · imclab/DeepLearningTutorials@3fe0484
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: code/rnnrbm.py +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -258,9 +258,13 @@ def generate(self, filename, show=True): |
258 | 258 | pylab.title('generated piano-roll') |
259 | 259 |
|
260 | 260 |
|
261 | | -if __name__ == '__main__': |
| 261 | +def test_rnnrbm(batch_size=100, num_epochs=200): |
262 | 262 | model = RnnRbm() |
263 | | - model.train(glob.glob('../data/Nottingham/train/*.mid')) |
| 263 | + model.train(glob.glob('../data/Nottingham/train/*.mid'), |
| 264 | + batch_size=batch_size, num_epochs=num_epochs) |
| 265 | + |
| 266 | +if __name__ == '__main__': |
| 267 | + test_rnnrbm() |
264 | 268 | model.generate('sample1.mid') |
265 | 269 | model.generate('sample2.mid') |
266 | 270 | pylab.show() |
Collapse file
Copy file name to clipboardExpand all lines: code/test.py +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
10 | 10 | import logistic_sgd |
11 | 11 | import mlp |
12 | 12 | import rbm |
| 13 | +import rnnrbm |
13 | 14 | import SdA |
14 | 15 |
|
15 | 16 |
|
@@ -49,6 +50,8 @@ def test_rbm(): |
49 | 50 | rbm.test_rbm(training_epochs=1, batch_size=300, n_chains=1, n_samples=1, |
50 | 51 | n_hidden=20, output_folder='tmp_rbm_plots') |
51 | 52 |
|
| 53 | +def test_rnnrbm(): |
| 54 | + rnnrbm.test_rnnrbm(num_epochs=1) |
52 | 55 |
|
53 | 56 | def speed(): |
54 | 57 | """ |
|