Merge pull request #32 from pswietojanski/master

bugfix to dropout (wrong scaling)
This commit is contained in:
Pawel Swietojanski 2015-11-16 13:57:00 +00:00
commit 53f2ea115f
2 changed files with 293 additions and 406 deletions

View File

@ -147,7 +147,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {
"collapsed": false
},
@ -176,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"metadata": {
"collapsed": false,
"scrolled": true
@ -189,98 +189,98 @@
"INFO:root:Training started...\n",
"INFO:mlp.optimisers:Epoch 0: Training cost (ce) for initial model is 2.624. Accuracy is 8.60%\n",
"INFO:mlp.optimisers:Epoch 0: Validation cost (ce) for initial model is 2.554. Accuracy is 9.84%\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 2.631. Accuracy is 59.70%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.679. Accuracy is 77.66%\n",
"INFO:mlp.optimisers:Epoch 1: Took 9 seconds. Training speed 295 pps. Validation speed 1648 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 0.497. Accuracy is 83.10%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.449. Accuracy is 86.47%\n",
"INFO:mlp.optimisers:Epoch 2: Took 10 seconds. Training speed 281 pps. Validation speed 1656 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 0.339. Accuracy is 90.20%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.390. Accuracy is 88.50%\n",
"INFO:mlp.optimisers:Epoch 3: Took 9 seconds. Training speed 302 pps. Validation speed 1624 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.237. Accuracy is 93.00%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.400. Accuracy is 88.40%\n",
"INFO:mlp.optimisers:Epoch 4: Took 9 seconds. Training speed 314 pps. Validation speed 1621 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.182. Accuracy is 95.20%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.427. Accuracy is 88.01%\n",
"INFO:mlp.optimisers:Epoch 5: Took 10 seconds. Training speed 311 pps. Validation speed 1590 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.139. Accuracy is 96.10%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.409. Accuracy is 88.26%\n",
"INFO:mlp.optimisers:Epoch 6: Took 9 seconds. Training speed 333 pps. Validation speed 1598 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.095. Accuracy is 98.30%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.370. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 7: Took 9 seconds. Training speed 334 pps. Validation speed 1568 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.069. Accuracy is 99.00%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.407. Accuracy is 89.28%\n",
"INFO:mlp.optimisers:Epoch 8: Took 9 seconds. Training speed 315 pps. Validation speed 1610 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.053. Accuracy is 99.50%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.382. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 9: Took 10 seconds. Training speed 316 pps. Validation speed 1439 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.039. Accuracy is 99.50%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.402. Accuracy is 89.77%\n",
"INFO:mlp.optimisers:Epoch 10: Took 10 seconds. Training speed 326 pps. Validation speed 1456 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.031. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.424. Accuracy is 89.40%\n",
"INFO:mlp.optimisers:Epoch 11: Took 9 seconds. Training speed 314 pps. Validation speed 1610 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.024. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.448. Accuracy is 88.64%\n",
"INFO:mlp.optimisers:Epoch 12: Took 9 seconds. Training speed 305 pps. Validation speed 1712 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.020. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.406. Accuracy is 90.36%\n",
"INFO:mlp.optimisers:Epoch 13: Took 9 seconds. Training speed 317 pps. Validation speed 1664 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.016. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.420. Accuracy is 89.97%\n",
"INFO:mlp.optimisers:Epoch 14: Took 9 seconds. Training speed 327 pps. Validation speed 1572 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 0.014. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 0.423. Accuracy is 89.82%\n",
"INFO:mlp.optimisers:Epoch 15: Took 9 seconds. Training speed 330 pps. Validation speed 1710 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Training cost (ce) is 0.012. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 0.427. Accuracy is 90.01%\n",
"INFO:mlp.optimisers:Epoch 16: Took 9 seconds. Training speed 324 pps. Validation speed 1637 pps.\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 2.932. Accuracy is 60.20%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.662. Accuracy is 77.58%\n",
"INFO:mlp.optimisers:Epoch 1: Took 10 seconds. Training speed 306 pps. Validation speed 1506 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 0.503. Accuracy is 84.30%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.480. Accuracy is 85.00%\n",
"INFO:mlp.optimisers:Epoch 2: Took 11 seconds. Training speed 205 pps. Validation speed 1593 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 0.350. Accuracy is 88.70%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.424. Accuracy is 86.80%\n",
"INFO:mlp.optimisers:Epoch 3: Took 10 seconds. Training speed 278 pps. Validation speed 1502 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.233. Accuracy is 93.70%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.443. Accuracy is 87.10%\n",
"INFO:mlp.optimisers:Epoch 4: Took 10 seconds. Training speed 263 pps. Validation speed 1508 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.184. Accuracy is 94.90%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.418. Accuracy is 87.77%\n",
"INFO:mlp.optimisers:Epoch 5: Took 11 seconds. Training speed 257 pps. Validation speed 1511 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.135. Accuracy is 96.50%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.415. Accuracy is 88.59%\n",
"INFO:mlp.optimisers:Epoch 6: Took 11 seconds. Training speed 212 pps. Validation speed 1511 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.094. Accuracy is 97.90%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.403. Accuracy is 89.35%\n",
"INFO:mlp.optimisers:Epoch 7: Took 11 seconds. Training speed 226 pps. Validation speed 1621 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.066. Accuracy is 98.90%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.400. Accuracy is 89.45%\n",
"INFO:mlp.optimisers:Epoch 8: Took 11 seconds. Training speed 238 pps. Validation speed 1495 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.054. Accuracy is 99.30%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.399. Accuracy is 89.42%\n",
"INFO:mlp.optimisers:Epoch 9: Took 10 seconds. Training speed 307 pps. Validation speed 1543 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.042. Accuracy is 99.30%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.398. Accuracy is 89.59%\n",
"INFO:mlp.optimisers:Epoch 10: Took 11 seconds. Training speed 245 pps. Validation speed 1520 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.032. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.401. Accuracy is 90.02%\n",
"INFO:mlp.optimisers:Epoch 11: Took 11 seconds. Training speed 204 pps. Validation speed 1532 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.025. Accuracy is 99.80%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.402. Accuracy is 90.23%\n",
"INFO:mlp.optimisers:Epoch 12: Took 11 seconds. Training speed 237 pps. Validation speed 1511 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.020. Accuracy is 99.80%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.406. Accuracy is 90.01%\n",
"INFO:mlp.optimisers:Epoch 13: Took 11 seconds. Training speed 219 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.017. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.415. Accuracy is 89.85%\n",
"INFO:mlp.optimisers:Epoch 14: Took 10 seconds. Training speed 257 pps. Validation speed 1605 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 0.015. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 0.423. Accuracy is 89.95%\n",
"INFO:mlp.optimisers:Epoch 15: Took 11 seconds. Training speed 205 pps. Validation speed 1613 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Training cost (ce) is 0.013. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 0.421. Accuracy is 90.05%\n",
"INFO:mlp.optimisers:Epoch 16: Took 11 seconds. Training speed 223 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Training cost (ce) is 0.011. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 0.426. Accuracy is 90.13%\n",
"INFO:mlp.optimisers:Epoch 17: Took 9 seconds. Training speed 313 pps. Validation speed 1656 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 0.427. Accuracy is 90.09%\n",
"INFO:mlp.optimisers:Epoch 17: Took 10 seconds. Training speed 309 pps. Validation speed 1541 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Training cost (ce) is 0.010. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 0.426. Accuracy is 90.16%\n",
"INFO:mlp.optimisers:Epoch 18: Took 9 seconds. Training speed 306 pps. Validation speed 1672 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 0.432. Accuracy is 90.02%\n",
"INFO:mlp.optimisers:Epoch 18: Took 11 seconds. Training speed 220 pps. Validation speed 1598 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Training cost (ce) is 0.009. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 0.428. Accuracy is 90.27%\n",
"INFO:mlp.optimisers:Epoch 19: Took 9 seconds. Training speed 307 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 0.429. Accuracy is 89.99%\n",
"INFO:mlp.optimisers:Epoch 19: Took 11 seconds. Training speed 216 pps. Validation speed 1543 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 0.008. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 0.435. Accuracy is 90.06%\n",
"INFO:mlp.optimisers:Epoch 20: Took 9 seconds. Training speed 310 pps. Validation speed 1621 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 0.433. Accuracy is 90.12%\n",
"INFO:mlp.optimisers:Epoch 20: Took 11 seconds. Training speed 224 pps. Validation speed 1449 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Training cost (ce) is 0.008. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 0.429. Accuracy is 90.35%\n",
"INFO:mlp.optimisers:Epoch 21: Took 9 seconds. Training speed 309 pps. Validation speed 1608 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 0.440. Accuracy is 90.07%\n",
"INFO:mlp.optimisers:Epoch 21: Took 11 seconds. Training speed 220 pps. Validation speed 1548 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Training cost (ce) is 0.007. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 0.440. Accuracy is 90.05%\n",
"INFO:mlp.optimisers:Epoch 22: Took 9 seconds. Training speed 307 pps. Validation speed 1670 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 0.435. Accuracy is 90.19%\n",
"INFO:mlp.optimisers:Epoch 22: Took 10 seconds. Training speed 269 pps. Validation speed 1522 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Training cost (ce) is 0.007. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 0.442. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 23: Took 9 seconds. Training speed 308 pps. Validation speed 1650 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 0.440. Accuracy is 90.08%\n",
"INFO:mlp.optimisers:Epoch 23: Took 11 seconds. Training speed 233 pps. Validation speed 1488 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 0.006. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 0.443. Accuracy is 90.14%\n",
"INFO:mlp.optimisers:Epoch 24: Took 9 seconds. Training speed 330 pps. Validation speed 1642 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 0.441. Accuracy is 90.11%\n",
"INFO:mlp.optimisers:Epoch 24: Took 10 seconds. Training speed 253 pps. Validation speed 1626 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Training cost (ce) is 0.006. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 0.441. Accuracy is 90.26%\n",
"INFO:mlp.optimisers:Epoch 25: Took 9 seconds. Training speed 322 pps. Validation speed 1659 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 0.445. Accuracy is 90.12%\n",
"INFO:mlp.optimisers:Epoch 25: Took 10 seconds. Training speed 309 pps. Validation speed 1522 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Training cost (ce) is 0.006. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 0.442. Accuracy is 90.30%\n",
"INFO:mlp.optimisers:Epoch 26: Took 9 seconds. Training speed 314 pps. Validation speed 1590 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 0.446. Accuracy is 90.11%\n",
"INFO:mlp.optimisers:Epoch 26: Took 11 seconds. Training speed 226 pps. Validation speed 1626 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Training cost (ce) is 0.005. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 0.445. Accuracy is 90.28%\n",
"INFO:mlp.optimisers:Epoch 27: Took 9 seconds. Training speed 304 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 0.450. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 27: Took 11 seconds. Training speed 228 pps. Validation speed 1539 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Training cost (ce) is 0.005. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 0.450. Accuracy is 90.21%\n",
"INFO:mlp.optimisers:Epoch 28: Took 9 seconds. Training speed 309 pps. Validation speed 1629 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 0.449. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 28: Took 11 seconds. Training speed 209 pps. Validation speed 1626 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Training cost (ce) is 0.005. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 0.454. Accuracy is 90.21%\n",
"INFO:mlp.optimisers:Epoch 29: Took 9 seconds. Training speed 312 pps. Validation speed 1664 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 0.005. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 0.455. Accuracy is 90.17%\n",
"INFO:mlp.optimisers:Epoch 30: Took 10 seconds. Training speed 302 pps. Validation speed 1590 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 0.449. Accuracy is 90.14%\n",
"INFO:mlp.optimisers:Epoch 29: Took 11 seconds. Training speed 211 pps. Validation speed 1522 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 0.004. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 0.449. Accuracy is 90.24%\n",
"INFO:mlp.optimisers:Epoch 30: Took 11 seconds. Training speed 200 pps. Validation speed 1640 pps.\n",
"INFO:root:Testing the model on test set:\n",
"INFO:root:MNIST test set accuracy is 89.24 %, cost (ce) is 0.464\n"
"INFO:root:MNIST test set accuracy is 89.58 %, cost (ce) is 0.454\n"
]
}
],
@ -348,7 +348,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 4,
"metadata": {
"collapsed": false,
"scrolled": true
@ -358,101 +358,102 @@
"name": "stderr",
"output_type": "stream",
"text": [
"ERROR: Line magic function `%autoreload` not found.\n",
"INFO:root:Training started...\n",
"INFO:mlp.optimisers:Epoch 0: Training cost (ce) for initial model is 8.934. Accuracy is 8.60%\n",
"INFO:mlp.optimisers:Epoch 0: Validation cost (ce) for initial model is 8.863. Accuracy is 9.84%\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 9.299. Accuracy is 58.20%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 6.952. Accuracy is 81.23%\n",
"INFO:mlp.optimisers:Epoch 1: Took 12 seconds. Training speed 261 pps. Validation speed 1285 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 6.838. Accuracy is 84.10%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 6.776. Accuracy is 86.86%\n",
"INFO:mlp.optimisers:Epoch 2: Took 10 seconds. Training speed 248 pps. Validation speed 1546 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 6.661. Accuracy is 89.60%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 6.741. Accuracy is 87.56%\n",
"INFO:mlp.optimisers:Epoch 3: Took 11 seconds. Training speed 257 pps. Validation speed 1499 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 6.541. Accuracy is 92.60%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 6.729. Accuracy is 87.59%\n",
"INFO:mlp.optimisers:Epoch 4: Took 10 seconds. Training speed 268 pps. Validation speed 1495 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 6.458. Accuracy is 95.30%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 6.853. Accuracy is 82.51%\n",
"INFO:mlp.optimisers:Epoch 5: Took 12 seconds. Training speed 267 pps. Validation speed 1220 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 6.400. Accuracy is 96.80%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 6.636. Accuracy is 89.53%\n",
"INFO:mlp.optimisers:Epoch 6: Took 12 seconds. Training speed 258 pps. Validation speed 1235 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 6.333. Accuracy is 98.40%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 6.622. Accuracy is 89.54%\n",
"INFO:mlp.optimisers:Epoch 7: Took 12 seconds. Training speed 253 pps. Validation speed 1214 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 6.290. Accuracy is 98.70%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 6.616. Accuracy is 89.02%\n",
"INFO:mlp.optimisers:Epoch 8: Took 14 seconds. Training speed 253 pps. Validation speed 1023 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 6.246. Accuracy is 99.20%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 6.576. Accuracy is 89.49%\n",
"INFO:mlp.optimisers:Epoch 9: Took 12 seconds. Training speed 259 pps. Validation speed 1299 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 6.206. Accuracy is 99.40%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 6.554. Accuracy is 89.61%\n",
"INFO:mlp.optimisers:Epoch 10: Took 11 seconds. Training speed 270 pps. Validation speed 1307 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 6.172. Accuracy is 99.50%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 6.533. Accuracy is 89.83%\n",
"INFO:mlp.optimisers:Epoch 11: Took 12 seconds. Training speed 252 pps. Validation speed 1205 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 6.136. Accuracy is 99.40%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 6.517. Accuracy is 89.65%\n",
"INFO:mlp.optimisers:Epoch 12: Took 12 seconds. Training speed 255 pps. Validation speed 1292 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 6.105. Accuracy is 99.60%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 6.484. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 13: Took 12 seconds. Training speed 257 pps. Validation speed 1290 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 6.074. Accuracy is 99.80%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 6.457. Accuracy is 89.87%\n",
"INFO:mlp.optimisers:Epoch 14: Took 11 seconds. Training speed 260 pps. Validation speed 1337 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 6.041. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 6.439. Accuracy is 89.76%\n",
"INFO:mlp.optimisers:Epoch 15: Took 11 seconds. Training speed 263 pps. Validation speed 1311 pps.\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 9.197. Accuracy is 58.30%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 6.979. Accuracy is 79.61%\n",
"INFO:mlp.optimisers:Epoch 1: Took 11 seconds. Training speed 219 pps. Validation speed 1518 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 6.832. Accuracy is 84.20%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 6.781. Accuracy is 86.57%\n",
"INFO:mlp.optimisers:Epoch 2: Took 10 seconds. Training speed 268 pps. Validation speed 1637 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 6.638. Accuracy is 89.80%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 6.763. Accuracy is 86.27%\n",
"INFO:mlp.optimisers:Epoch 3: Took 11 seconds. Training speed 220 pps. Validation speed 1520 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 6.545. Accuracy is 92.00%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 6.839. Accuracy is 84.72%\n",
"INFO:mlp.optimisers:Epoch 4: Took 11 seconds. Training speed 230 pps. Validation speed 1495 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 6.465. Accuracy is 94.90%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 6.831. Accuracy is 83.27%\n",
"INFO:mlp.optimisers:Epoch 5: Took 11 seconds. Training speed 216 pps. Validation speed 1616 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 6.393. Accuracy is 96.60%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 6.674. Accuracy is 88.24%\n",
"INFO:mlp.optimisers:Epoch 6: Took 11 seconds. Training speed 212 pps. Validation speed 1502 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 6.332. Accuracy is 98.50%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 6.616. Accuracy is 89.67%\n",
"INFO:mlp.optimisers:Epoch 7: Took 11 seconds. Training speed 220 pps. Validation speed 1493 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 6.284. Accuracy is 99.00%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 6.635. Accuracy is 88.19%\n",
"INFO:mlp.optimisers:Epoch 8: Took 11 seconds. Training speed 225 pps. Validation speed 1624 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 6.241. Accuracy is 99.20%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 6.599. Accuracy is 89.06%\n",
"INFO:mlp.optimisers:Epoch 9: Took 10 seconds. Training speed 263 pps. Validation speed 1536 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 6.204. Accuracy is 99.40%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 6.548. Accuracy is 90.05%\n",
"INFO:mlp.optimisers:Epoch 10: Took 11 seconds. Training speed 232 pps. Validation speed 1541 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 6.171. Accuracy is 99.60%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 6.534. Accuracy is 89.84%\n",
"INFO:mlp.optimisers:Epoch 11: Took 11 seconds. Training speed 223 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 6.135. Accuracy is 99.60%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 6.511. Accuracy is 89.93%\n",
"INFO:mlp.optimisers:Epoch 12: Took 12 seconds. Training speed 207 pps. Validation speed 1488 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 6.104. Accuracy is 99.60%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 6.497. Accuracy is 89.85%\n",
"INFO:mlp.optimisers:Epoch 13: Took 11 seconds. Training speed 210 pps. Validation speed 1488 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 6.072. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 6.512. Accuracy is 88.62%\n",
"INFO:mlp.optimisers:Epoch 14: Took 11 seconds. Training speed 237 pps. Validation speed 1497 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 6.046. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 6.443. Accuracy is 89.84%\n",
"INFO:mlp.optimisers:Epoch 15: Took 11 seconds. Training speed 227 pps. Validation speed 1490 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Training cost (ce) is 6.011. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 6.411. Accuracy is 89.89%\n",
"INFO:mlp.optimisers:Epoch 16: Took 12 seconds. Training speed 261 pps. Validation speed 1263 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Training cost (ce) is 5.981. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 6.385. Accuracy is 89.94%\n",
"INFO:mlp.optimisers:Epoch 17: Took 12 seconds. Training speed 258 pps. Validation speed 1276 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 6.416. Accuracy is 89.92%\n",
"INFO:mlp.optimisers:Epoch 16: Took 10 seconds. Training speed 261 pps. Validation speed 1541 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Training cost (ce) is 5.982. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 6.390. Accuracy is 89.72%\n",
"INFO:mlp.optimisers:Epoch 17: Took 11 seconds. Training speed 218 pps. Validation speed 1499 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Training cost (ce) is 5.952. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 6.360. Accuracy is 89.98%\n",
"INFO:mlp.optimisers:Epoch 18: Took 12 seconds. Training speed 255 pps. Validation speed 1306 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Training cost (ce) is 5.922. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 6.335. Accuracy is 89.86%\n",
"INFO:mlp.optimisers:Epoch 19: Took 10 seconds. Training speed 259 pps. Validation speed 1536 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 5.893. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 6.312. Accuracy is 89.92%\n",
"INFO:mlp.optimisers:Epoch 20: Took 12 seconds. Training speed 255 pps. Validation speed 1255 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 6.358. Accuracy is 89.97%\n",
"INFO:mlp.optimisers:Epoch 18: Took 11 seconds. Training speed 208 pps. Validation speed 1518 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Training cost (ce) is 5.923. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 6.332. Accuracy is 90.23%\n",
"INFO:mlp.optimisers:Epoch 19: Took 11 seconds. Training speed 210 pps. Validation speed 1600 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 5.894. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 6.311. Accuracy is 90.03%\n",
"INFO:mlp.optimisers:Epoch 20: Took 11 seconds. Training speed 209 pps. Validation speed 1506 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Training cost (ce) is 5.864. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 6.283. Accuracy is 89.84%\n",
"INFO:mlp.optimisers:Epoch 21: Took 10 seconds. Training speed 279 pps. Validation speed 1543 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 6.286. Accuracy is 89.97%\n",
"INFO:mlp.optimisers:Epoch 21: Took 11 seconds. Training speed 209 pps. Validation speed 1546 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Training cost (ce) is 5.835. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 6.258. Accuracy is 89.92%\n",
"INFO:mlp.optimisers:Epoch 22: Took 11 seconds. Training speed 254 pps. Validation speed 1335 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Training cost (ce) is 5.806. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 6.232. Accuracy is 89.97%\n",
"INFO:mlp.optimisers:Epoch 23: Took 11 seconds. Training speed 256 pps. Validation speed 1378 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 5.777. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 6.202. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 24: Took 13 seconds. Training speed 255 pps. Validation speed 1133 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Training cost (ce) is 5.748. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 6.178. Accuracy is 89.96%\n",
"INFO:mlp.optimisers:Epoch 25: Took 12 seconds. Training speed 253 pps. Validation speed 1233 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 6.255. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 22: Took 11 seconds. Training speed 211 pps. Validation speed 1495 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Training cost (ce) is 5.807. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 6.227. Accuracy is 90.08%\n",
"INFO:mlp.optimisers:Epoch 23: Took 10 seconds. Training speed 268 pps. Validation speed 1626 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 5.778. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 6.203. Accuracy is 90.03%\n",
"INFO:mlp.optimisers:Epoch 24: Took 11 seconds. Training speed 210 pps. Validation speed 1502 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Training cost (ce) is 5.749. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 6.176. Accuracy is 90.06%\n",
"INFO:mlp.optimisers:Epoch 25: Took 11 seconds. Training speed 205 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Training cost (ce) is 5.720. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 6.157. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 26: Took 12 seconds. Training speed 259 pps. Validation speed 1260 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 6.149. Accuracy is 90.01%\n",
"INFO:mlp.optimisers:Epoch 26: Took 11 seconds. Training speed 215 pps. Validation speed 1495 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Training cost (ce) is 5.691. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 6.125. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 27: Took 11 seconds. Training speed 283 pps. Validation speed 1357 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Training cost (ce) is 5.662. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 6.099. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 28: Took 12 seconds. Training speed 257 pps. Validation speed 1247 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 6.125. Accuracy is 90.09%\n",
"INFO:mlp.optimisers:Epoch 27: Took 12 seconds. Training speed 198 pps. Validation speed 1508 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Training cost (ce) is 5.663. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 6.097. Accuracy is 89.93%\n",
"INFO:mlp.optimisers:Epoch 28: Took 11 seconds. Training speed 207 pps. Validation speed 1518 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Training cost (ce) is 5.634. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 6.067. Accuracy is 90.03%\n",
"INFO:mlp.optimisers:Epoch 29: Took 12 seconds. Training speed 257 pps. Validation speed 1256 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 5.605. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 6.043. Accuracy is 89.94%\n",
"INFO:mlp.optimisers:Epoch 30: Took 12 seconds. Training speed 256 pps. Validation speed 1285 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 6.070. Accuracy is 90.09%\n",
"INFO:mlp.optimisers:Epoch 29: Took 11 seconds. Training speed 218 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 5.606. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 6.043. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 30: Took 10 seconds. Training speed 268 pps. Validation speed 1543 pps.\n",
"INFO:root:Testing the model on test set:\n",
"INFO:root:MNIST test set accuracy is 89.30 %, cost (ce) is 0.448\n"
"INFO:root:MNIST test set accuracy is 89.25 %, cost (ce) is 0.451\n"
]
}
],
@ -523,7 +524,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 5,
"metadata": {
"collapsed": false,
"scrolled": true
@ -533,101 +534,102 @@
"name": "stderr",
"output_type": "stream",
"text": [
"ERROR: Line magic function `%autoreload` not found.\n",
"INFO:root:Training started...\n",
"INFO:mlp.optimisers:Epoch 0: Training cost (ce) for initial model is 2.666. Accuracy is 8.60%\n",
"INFO:mlp.optimisers:Epoch 0: Validation cost (ce) for initial model is 2.595. Accuracy is 9.84%\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 2.862. Accuracy is 58.70%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.772. Accuracy is 75.41%\n",
"INFO:mlp.optimisers:Epoch 1: Took 12 seconds. Training speed 255 pps. Validation speed 1302 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 0.544. Accuracy is 83.30%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.547. Accuracy is 83.96%\n",
"INFO:mlp.optimisers:Epoch 2: Took 11 seconds. Training speed 252 pps. Validation speed 1397 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 0.361. Accuracy is 90.60%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.538. Accuracy is 84.64%\n",
"INFO:mlp.optimisers:Epoch 3: Took 9 seconds. Training speed 328 pps. Validation speed 1565 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.270. Accuracy is 92.70%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.442. Accuracy is 88.85%\n",
"INFO:mlp.optimisers:Epoch 4: Took 12 seconds. Training speed 250 pps. Validation speed 1299 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.218. Accuracy is 94.60%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.444. Accuracy is 88.78%\n",
"INFO:mlp.optimisers:Epoch 5: Took 10 seconds. Training speed 294 pps. Validation speed 1543 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.179. Accuracy is 96.60%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.462. Accuracy is 88.42%\n",
"INFO:mlp.optimisers:Epoch 6: Took 10 seconds. Training speed 307 pps. Validation speed 1543 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.135. Accuracy is 98.40%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.418. Accuracy is 89.87%\n",
"INFO:mlp.optimisers:Epoch 7: Took 10 seconds. Training speed 297 pps. Validation speed 1548 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.109. Accuracy is 99.30%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.434. Accuracy is 89.65%\n",
"INFO:mlp.optimisers:Epoch 8: Took 12 seconds. Training speed 292 pps. Validation speed 1217 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.089. Accuracy is 99.30%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.451. Accuracy is 89.26%\n",
"INFO:mlp.optimisers:Epoch 9: Took 11 seconds. Training speed 311 pps. Validation speed 1348 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.088. Accuracy is 99.50%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.459. Accuracy is 89.22%\n",
"INFO:mlp.optimisers:Epoch 10: Took 9 seconds. Training speed 325 pps. Validation speed 1600 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.074. Accuracy is 99.80%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.443. Accuracy is 90.03%\n",
"INFO:mlp.optimisers:Epoch 11: Took 11 seconds. Training speed 274 pps. Validation speed 1325 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.070. Accuracy is 99.80%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.452. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 12: Took 12 seconds. Training speed 288 pps. Validation speed 1133 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.064. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.485. Accuracy is 89.01%\n",
"INFO:mlp.optimisers:Epoch 13: Took 11 seconds. Training speed 315 pps. Validation speed 1218 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.060. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.457. Accuracy is 90.14%\n",
"INFO:mlp.optimisers:Epoch 14: Took 12 seconds. Training speed 282 pps. Validation speed 1245 pps.\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 2.884. Accuracy is 59.10%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.622. Accuracy is 81.68%\n",
"INFO:mlp.optimisers:Epoch 1: Took 11 seconds. Training speed 215 pps. Validation speed 1504 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 0.543. Accuracy is 84.40%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.523. Accuracy is 85.20%\n",
"INFO:mlp.optimisers:Epoch 2: Took 12 seconds. Training speed 205 pps. Validation speed 1508 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 0.401. Accuracy is 88.30%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.524. Accuracy is 85.17%\n",
"INFO:mlp.optimisers:Epoch 3: Took 12 seconds. Training speed 200 pps. Validation speed 1460 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.271. Accuracy is 93.20%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.484. Accuracy is 86.72%\n",
"INFO:mlp.optimisers:Epoch 4: Took 11 seconds. Training speed 206 pps. Validation speed 1518 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.220. Accuracy is 95.70%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.452. Accuracy is 88.28%\n",
"INFO:mlp.optimisers:Epoch 5: Took 10 seconds. Training speed 245 pps. Validation speed 1590 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.169. Accuracy is 97.00%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.427. Accuracy is 89.22%\n",
"INFO:mlp.optimisers:Epoch 6: Took 10 seconds. Training speed 277 pps. Validation speed 1575 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.137. Accuracy is 98.10%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.460. Accuracy is 88.52%\n",
"INFO:mlp.optimisers:Epoch 7: Took 10 seconds. Training speed 280 pps. Validation speed 1534 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.112. Accuracy is 98.90%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.433. Accuracy is 89.40%\n",
"INFO:mlp.optimisers:Epoch 8: Took 10 seconds. Training speed 269 pps. Validation speed 1482 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.099. Accuracy is 98.80%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.436. Accuracy is 89.63%\n",
"INFO:mlp.optimisers:Epoch 9: Took 12 seconds. Training speed 214 pps. Validation speed 1335 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.083. Accuracy is 99.60%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.441. Accuracy is 89.92%\n",
"INFO:mlp.optimisers:Epoch 10: Took 12 seconds. Training speed 200 pps. Validation speed 1425 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.076. Accuracy is 99.70%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.443. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 11: Took 11 seconds. Training speed 246 pps. Validation speed 1445 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.068. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.444. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 12: Took 11 seconds. Training speed 220 pps. Validation speed 1469 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.066. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.459. Accuracy is 89.96%\n",
"INFO:mlp.optimisers:Epoch 13: Took 12 seconds. Training speed 201 pps. Validation speed 1518 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.062. Accuracy is 99.90%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.462. Accuracy is 89.66%\n",
"INFO:mlp.optimisers:Epoch 14: Took 10 seconds. Training speed 295 pps. Validation speed 1532 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 0.059. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 0.459. Accuracy is 90.29%\n",
"INFO:mlp.optimisers:Epoch 15: Took 11 seconds. Training speed 280 pps. Validation speed 1268 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 0.469. Accuracy is 89.78%\n",
"INFO:mlp.optimisers:Epoch 15: Took 11 seconds. Training speed 252 pps. Validation speed 1383 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Training cost (ce) is 0.057. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 0.465. Accuracy is 90.00%\n",
"INFO:mlp.optimisers:Epoch 16: Took 10 seconds. Training speed 328 pps. Validation speed 1368 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 0.466. Accuracy is 90.07%\n",
"INFO:mlp.optimisers:Epoch 16: Took 12 seconds. Training speed 206 pps. Validation speed 1445 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Training cost (ce) is 0.056. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 0.467. Accuracy is 90.14%\n",
"INFO:mlp.optimisers:Epoch 17: Took 11 seconds. Training speed 273 pps. Validation speed 1287 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 0.466. Accuracy is 90.02%\n",
"INFO:mlp.optimisers:Epoch 17: Took 11 seconds. Training speed 238 pps. Validation speed 1458 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Training cost (ce) is 0.055. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 0.475. Accuracy is 90.15%\n",
"INFO:mlp.optimisers:Epoch 18: Took 11 seconds. Training speed 279 pps. Validation speed 1279 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 0.474. Accuracy is 90.06%\n",
"INFO:mlp.optimisers:Epoch 18: Took 11 seconds. Training speed 236 pps. Validation speed 1399 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Training cost (ce) is 0.054. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 0.473. Accuracy is 90.06%\n",
"INFO:mlp.optimisers:Epoch 19: Took 12 seconds. Training speed 284 pps. Validation speed 1188 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 0.053. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 0.478. Accuracy is 90.06%\n",
"INFO:mlp.optimisers:Epoch 20: Took 13 seconds. Training speed 250 pps. Validation speed 1172 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Took 11 seconds. Training speed 221 pps. Validation speed 1441 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 0.054. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 0.480. Accuracy is 89.99%\n",
"INFO:mlp.optimisers:Epoch 20: Took 12 seconds. Training speed 203 pps. Validation speed 1401 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Training cost (ce) is 0.053. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 0.484. Accuracy is 90.05%\n",
"INFO:mlp.optimisers:Epoch 21: Took 11 seconds. Training speed 255 pps. Validation speed 1325 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 0.481. Accuracy is 90.08%\n",
"INFO:mlp.optimisers:Epoch 21: Took 10 seconds. Training speed 295 pps. Validation speed 1471 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Training cost (ce) is 0.052. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 0.485. Accuracy is 90.21%\n",
"INFO:mlp.optimisers:Epoch 22: Took 10 seconds. Training speed 328 pps. Validation speed 1353 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 0.487. Accuracy is 89.90%\n",
"INFO:mlp.optimisers:Epoch 22: Took 11 seconds. Training speed 238 pps. Validation speed 1466 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Training cost (ce) is 0.052. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 0.484. Accuracy is 90.08%\n",
"INFO:mlp.optimisers:Epoch 23: Took 11 seconds. Training speed 266 pps. Validation speed 1332 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 0.051. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 0.485. Accuracy is 90.17%\n",
"INFO:mlp.optimisers:Epoch 24: Took 10 seconds. Training speed 281 pps. Validation speed 1520 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 0.485. Accuracy is 90.00%\n",
"INFO:mlp.optimisers:Epoch 23: Took 12 seconds. Training speed 205 pps. Validation speed 1314 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 0.052. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 0.488. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 24: Took 12 seconds. Training speed 203 pps. Validation speed 1493 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Training cost (ce) is 0.051. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 0.486. Accuracy is 90.26%\n",
"INFO:mlp.optimisers:Epoch 25: Took 11 seconds. Training speed 259 pps. Validation speed 1321 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 0.490. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 25: Took 11 seconds. Training speed 220 pps. Validation speed 1443 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Training cost (ce) is 0.051. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 0.487. Accuracy is 90.23%\n",
"INFO:mlp.optimisers:Epoch 26: Took 11 seconds. Training speed 283 pps. Validation speed 1344 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 0.492. Accuracy is 90.07%\n",
"INFO:mlp.optimisers:Epoch 26: Took 12 seconds. Training speed 211 pps. Validation speed 1387 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Training cost (ce) is 0.051. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 0.493. Accuracy is 90.25%\n",
"INFO:mlp.optimisers:Epoch 27: Took 11 seconds. Training speed 270 pps. Validation speed 1357 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 0.494. Accuracy is 89.98%\n",
"INFO:mlp.optimisers:Epoch 27: Took 12 seconds. Training speed 217 pps. Validation speed 1433 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Training cost (ce) is 0.050. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 0.493. Accuracy is 90.27%\n",
"INFO:mlp.optimisers:Epoch 28: Took 11 seconds. Training speed 283 pps. Validation speed 1302 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 0.494. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 28: Took 10 seconds. Training speed 296 pps. Validation speed 1475 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Training cost (ce) is 0.050. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 0.499. Accuracy is 90.22%\n",
"INFO:mlp.optimisers:Epoch 29: Took 10 seconds. Training speed 327 pps. Validation speed 1395 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 0.495. Accuracy is 90.19%\n",
"INFO:mlp.optimisers:Epoch 29: Took 12 seconds. Training speed 218 pps. Validation speed 1361 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 0.050. Accuracy is 100.00%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 0.497. Accuracy is 90.22%\n",
"INFO:mlp.optimisers:Epoch 30: Took 12 seconds. Training speed 268 pps. Validation speed 1142 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 0.501. Accuracy is 89.98%\n",
"INFO:mlp.optimisers:Epoch 30: Took 12 seconds. Training speed 222 pps. Validation speed 1321 pps.\n",
"INFO:root:Testing the model on test set:\n",
"INFO:root:MNIST test set accuracy is 89.30 %, cost (ce) is 0.459\n"
"INFO:root:MNIST test set accuracy is 89.24 %, cost (ce) is 0.460\n"
]
}
],
@ -792,7 +794,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": true
@ -802,169 +804,52 @@
"name": "stderr",
"output_type": "stream",
"text": [
"ERROR: Line magic function `%autoreload` not found.\n",
"INFO:root:Training started...\n",
"INFO:mlp.optimisers:Epoch 0: Training cost (ce) for initial model is 2.624. Accuracy is 8.60%\n",
"INFO:mlp.optimisers:Epoch 0: Validation cost (ce) for initial model is 2.554. Accuracy is 9.84%\n",
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 3.828. Accuracy is 50.90%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.716. Accuracy is 76.93%\n",
"INFO:mlp.optimisers:Epoch 1: Took 9 seconds. Training speed 295 pps. Validation speed 1692 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 1.132. Accuracy is 66.90%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.753. Accuracy is 78.82%\n",
"INFO:mlp.optimisers:Epoch 2: Took 10 seconds. Training speed 289 pps. Validation speed 1653 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 1.043. Accuracy is 71.90%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.501. Accuracy is 85.69%\n",
"INFO:mlp.optimisers:Epoch 3: Took 10 seconds. Training speed 280 pps. Validation speed 1681 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.810. Accuracy is 78.50%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.481. Accuracy is 85.92%\n",
"INFO:mlp.optimisers:Epoch 4: Took 9 seconds. Training speed 308 pps. Validation speed 1675 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.769. Accuracy is 79.40%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.588. Accuracy is 84.25%\n",
"INFO:mlp.optimisers:Epoch 5: Took 9 seconds. Training speed 320 pps. Validation speed 1733 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.792. Accuracy is 78.60%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.434. Accuracy is 88.49%\n",
"INFO:mlp.optimisers:Epoch 6: Took 9 seconds. Training speed 334 pps. Validation speed 1692 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.675. Accuracy is 82.00%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.514. Accuracy is 86.76%\n",
"INFO:mlp.optimisers:Epoch 7: Took 9 seconds. Training speed 284 pps. Validation speed 1704 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.808. Accuracy is 79.90%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.620. Accuracy is 84.22%\n",
"INFO:mlp.optimisers:Epoch 8: Took 9 seconds. Training speed 317 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.810. Accuracy is 79.90%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.645. Accuracy is 84.91%\n",
"INFO:mlp.optimisers:Epoch 9: Took 9 seconds. Training speed 304 pps. Validation speed 1675 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.631. Accuracy is 83.20%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.493. Accuracy is 88.80%\n",
"INFO:mlp.optimisers:Epoch 10: Took 10 seconds. Training speed 286 pps. Validation speed 1656 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.676. Accuracy is 83.90%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.598. Accuracy is 86.78%\n",
"INFO:mlp.optimisers:Epoch 11: Took 9 seconds. Training speed 296 pps. Validation speed 1710 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.659. Accuracy is 83.80%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.432. Accuracy is 90.21%\n",
"INFO:mlp.optimisers:Epoch 12: Took 9 seconds. Training speed 309 pps. Validation speed 1675 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.525. Accuracy is 86.80%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.490. Accuracy is 89.64%\n",
"INFO:mlp.optimisers:Epoch 13: Took 9 seconds. Training speed 320 pps. Validation speed 1681 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.488. Accuracy is 88.50%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.606. Accuracy is 86.87%\n",
"INFO:mlp.optimisers:Epoch 14: Took 9 seconds. Training speed 305 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 15: Training cost (ce) is 0.441. Accuracy is 88.30%\n",
"INFO:mlp.optimisers:Epoch 15: Validation cost (ce) is 0.570. Accuracy is 89.27%\n",
"INFO:mlp.optimisers:Epoch 15: Took 9 seconds. Training speed 331 pps. Validation speed 1736 pps.\n",
"INFO:mlp.optimisers:Epoch 16: Training cost (ce) is 0.478. Accuracy is 87.80%\n",
"INFO:mlp.optimisers:Epoch 16: Validation cost (ce) is 0.488. Accuracy is 90.52%\n",
"INFO:mlp.optimisers:Epoch 16: Took 9 seconds. Training speed 337 pps. Validation speed 1710 pps.\n",
"INFO:mlp.optimisers:Epoch 17: Training cost (ce) is 0.461. Accuracy is 89.60%\n",
"INFO:mlp.optimisers:Epoch 17: Validation cost (ce) is 0.736. Accuracy is 86.67%\n",
"INFO:mlp.optimisers:Epoch 17: Took 9 seconds. Training speed 294 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 18: Training cost (ce) is 0.440. Accuracy is 88.90%\n",
"INFO:mlp.optimisers:Epoch 18: Validation cost (ce) is 0.618. Accuracy is 88.99%\n",
"INFO:mlp.optimisers:Epoch 18: Took 10 seconds. Training speed 279 pps. Validation speed 1659 pps.\n",
"INFO:mlp.optimisers:Epoch 19: Training cost (ce) is 0.599. Accuracy is 87.40%\n",
"INFO:mlp.optimisers:Epoch 19: Validation cost (ce) is 0.487. Accuracy is 91.03%\n",
"INFO:mlp.optimisers:Epoch 19: Took 10 seconds. Training speed 281 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 20: Training cost (ce) is 0.447. Accuracy is 90.10%\n",
"INFO:mlp.optimisers:Epoch 20: Validation cost (ce) is 0.574. Accuracy is 89.52%\n",
"INFO:mlp.optimisers:Epoch 20: Took 10 seconds. Training speed 282 pps. Validation speed 1675 pps.\n",
"INFO:mlp.optimisers:Epoch 21: Training cost (ce) is 0.579. Accuracy is 87.80%\n",
"INFO:mlp.optimisers:Epoch 21: Validation cost (ce) is 0.550. Accuracy is 90.48%\n",
"INFO:mlp.optimisers:Epoch 21: Took 9 seconds. Training speed 302 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 22: Training cost (ce) is 0.461. Accuracy is 89.70%\n",
"INFO:mlp.optimisers:Epoch 22: Validation cost (ce) is 0.597. Accuracy is 90.02%\n",
"INFO:mlp.optimisers:Epoch 22: Took 9 seconds. Training speed 303 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 23: Training cost (ce) is 0.519. Accuracy is 89.50%\n",
"INFO:mlp.optimisers:Epoch 23: Validation cost (ce) is 0.645. Accuracy is 90.35%\n",
"INFO:mlp.optimisers:Epoch 23: Took 10 seconds. Training speed 277 pps. Validation speed 1670 pps.\n",
"INFO:mlp.optimisers:Epoch 24: Training cost (ce) is 0.439. Accuracy is 90.80%\n",
"INFO:mlp.optimisers:Epoch 24: Validation cost (ce) is 0.634. Accuracy is 90.04%\n",
"INFO:mlp.optimisers:Epoch 24: Took 10 seconds. Training speed 268 pps. Validation speed 1687 pps.\n",
"INFO:mlp.optimisers:Epoch 25: Training cost (ce) is 0.365. Accuracy is 91.50%\n",
"INFO:mlp.optimisers:Epoch 25: Validation cost (ce) is 0.564. Accuracy is 91.55%\n",
"INFO:mlp.optimisers:Epoch 25: Took 9 seconds. Training speed 309 pps. Validation speed 1733 pps.\n",
"INFO:mlp.optimisers:Epoch 26: Training cost (ce) is 0.391. Accuracy is 91.60%\n",
"INFO:mlp.optimisers:Epoch 26: Validation cost (ce) is 0.660. Accuracy is 90.20%\n",
"INFO:mlp.optimisers:Epoch 26: Took 9 seconds. Training speed 329 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 27: Training cost (ce) is 0.412. Accuracy is 91.40%\n",
"INFO:mlp.optimisers:Epoch 27: Validation cost (ce) is 0.614. Accuracy is 90.82%\n",
"INFO:mlp.optimisers:Epoch 27: Took 9 seconds. Training speed 281 pps. Validation speed 1698 pps.\n",
"INFO:mlp.optimisers:Epoch 28: Training cost (ce) is 0.470. Accuracy is 90.40%\n",
"INFO:mlp.optimisers:Epoch 28: Validation cost (ce) is 0.593. Accuracy is 91.29%\n",
"INFO:mlp.optimisers:Epoch 28: Took 10 seconds. Training speed 278 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 29: Training cost (ce) is 0.443. Accuracy is 90.90%\n",
"INFO:mlp.optimisers:Epoch 29: Validation cost (ce) is 0.623. Accuracy is 90.79%\n",
"INFO:mlp.optimisers:Epoch 29: Took 9 seconds. Training speed 309 pps. Validation speed 1661 pps.\n",
"INFO:mlp.optimisers:Epoch 30: Training cost (ce) is 0.359. Accuracy is 92.20%\n",
"INFO:mlp.optimisers:Epoch 30: Validation cost (ce) is 0.614. Accuracy is 90.74%\n",
"INFO:mlp.optimisers:Epoch 30: Took 9 seconds. Training speed 312 pps. Validation speed 1659 pps.\n",
"INFO:mlp.optimisers:Epoch 31: Training cost (ce) is 0.345. Accuracy is 92.30%\n",
"INFO:mlp.optimisers:Epoch 31: Validation cost (ce) is 0.698. Accuracy is 90.71%\n",
"INFO:mlp.optimisers:Epoch 31: Took 9 seconds. Training speed 292 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 32: Training cost (ce) is 0.443. Accuracy is 91.20%\n",
"INFO:mlp.optimisers:Epoch 32: Validation cost (ce) is 0.590. Accuracy is 91.87%\n",
"INFO:mlp.optimisers:Epoch 32: Took 9 seconds. Training speed 291 pps. Validation speed 1678 pps.\n",
"INFO:mlp.optimisers:Epoch 33: Training cost (ce) is 0.557. Accuracy is 91.00%\n",
"INFO:mlp.optimisers:Epoch 33: Validation cost (ce) is 0.624. Accuracy is 91.39%\n",
"INFO:mlp.optimisers:Epoch 33: Took 10 seconds. Training speed 277 pps. Validation speed 1687 pps.\n",
"INFO:mlp.optimisers:Epoch 34: Training cost (ce) is 0.451. Accuracy is 91.30%\n",
"INFO:mlp.optimisers:Epoch 34: Validation cost (ce) is 0.687. Accuracy is 91.12%\n",
"INFO:mlp.optimisers:Epoch 34: Took 9 seconds. Training speed 320 pps. Validation speed 1684 pps.\n",
"INFO:mlp.optimisers:Epoch 35: Training cost (ce) is 0.456. Accuracy is 91.40%\n",
"INFO:mlp.optimisers:Epoch 35: Validation cost (ce) is 0.723. Accuracy is 91.09%\n",
"INFO:mlp.optimisers:Epoch 35: Took 9 seconds. Training speed 336 pps. Validation speed 1721 pps.\n",
"INFO:mlp.optimisers:Epoch 36: Training cost (ce) is 0.379. Accuracy is 92.80%\n",
"INFO:mlp.optimisers:Epoch 36: Validation cost (ce) is 0.753. Accuracy is 90.54%\n",
"INFO:mlp.optimisers:Epoch 36: Took 9 seconds. Training speed 320 pps. Validation speed 1710 pps.\n",
"INFO:mlp.optimisers:Epoch 37: Training cost (ce) is 0.387. Accuracy is 93.10%\n",
"INFO:mlp.optimisers:Epoch 37: Validation cost (ce) is 0.721. Accuracy is 91.16%\n",
"INFO:mlp.optimisers:Epoch 37: Took 9 seconds. Training speed 306 pps. Validation speed 1692 pps.\n",
"INFO:mlp.optimisers:Epoch 38: Training cost (ce) is 0.489. Accuracy is 91.60%\n",
"INFO:mlp.optimisers:Epoch 38: Validation cost (ce) is 0.818. Accuracy is 89.82%\n",
"INFO:mlp.optimisers:Epoch 38: Took 9 seconds. Training speed 301 pps. Validation speed 1707 pps.\n",
"INFO:mlp.optimisers:Epoch 39: Training cost (ce) is 0.510. Accuracy is 91.70%\n",
"INFO:mlp.optimisers:Epoch 39: Validation cost (ce) is 0.690. Accuracy is 91.15%\n",
"INFO:mlp.optimisers:Epoch 39: Took 9 seconds. Training speed 296 pps. Validation speed 1712 pps.\n",
"INFO:mlp.optimisers:Epoch 40: Training cost (ce) is 0.560. Accuracy is 91.80%\n",
"INFO:mlp.optimisers:Epoch 40: Validation cost (ce) is 0.729. Accuracy is 91.11%\n",
"INFO:mlp.optimisers:Epoch 40: Took 9 seconds. Training speed 302 pps. Validation speed 1695 pps.\n",
"INFO:mlp.optimisers:Epoch 41: Training cost (ce) is 0.484. Accuracy is 91.50%\n",
"INFO:mlp.optimisers:Epoch 41: Validation cost (ce) is 0.629. Accuracy is 92.18%\n",
"INFO:mlp.optimisers:Epoch 41: Took 9 seconds. Training speed 325 pps. Validation speed 1689 pps.\n",
"INFO:mlp.optimisers:Epoch 42: Training cost (ce) is 0.327. Accuracy is 93.40%\n",
"INFO:mlp.optimisers:Epoch 42: Validation cost (ce) is 0.723. Accuracy is 91.48%\n",
"INFO:mlp.optimisers:Epoch 42: Took 9 seconds. Training speed 300 pps. Validation speed 1661 pps.\n",
"INFO:mlp.optimisers:Epoch 43: Training cost (ce) is 0.358. Accuracy is 93.50%\n",
"INFO:mlp.optimisers:Epoch 43: Validation cost (ce) is 0.665. Accuracy is 91.98%\n",
"INFO:mlp.optimisers:Epoch 43: Took 9 seconds. Training speed 291 pps. Validation speed 1707 pps.\n",
"INFO:mlp.optimisers:Epoch 44: Training cost (ce) is 0.441. Accuracy is 92.80%\n",
"INFO:mlp.optimisers:Epoch 44: Validation cost (ce) is 0.846. Accuracy is 90.96%\n",
"INFO:mlp.optimisers:Epoch 44: Took 9 seconds. Training speed 325 pps. Validation speed 1718 pps.\n",
"INFO:mlp.optimisers:Epoch 45: Training cost (ce) is 0.526. Accuracy is 91.10%\n",
"INFO:mlp.optimisers:Epoch 45: Validation cost (ce) is 0.674. Accuracy is 92.17%\n",
"INFO:mlp.optimisers:Epoch 45: Took 9 seconds. Training speed 317 pps. Validation speed 1710 pps.\n",
"INFO:mlp.optimisers:Epoch 46: Training cost (ce) is 0.407. Accuracy is 91.90%\n",
"INFO:mlp.optimisers:Epoch 46: Validation cost (ce) is 0.819. Accuracy is 90.26%\n",
"INFO:mlp.optimisers:Epoch 46: Took 9 seconds. Training speed 308 pps. Validation speed 1698 pps.\n",
"INFO:mlp.optimisers:Epoch 47: Training cost (ce) is 0.482. Accuracy is 92.60%\n",
"INFO:mlp.optimisers:Epoch 47: Validation cost (ce) is 0.752. Accuracy is 91.34%\n",
"INFO:mlp.optimisers:Epoch 47: Took 9 seconds. Training speed 286 pps. Validation speed 1687 pps.\n",
"INFO:mlp.optimisers:Epoch 48: Training cost (ce) is 0.405. Accuracy is 92.90%\n",
"INFO:mlp.optimisers:Epoch 48: Validation cost (ce) is 0.787. Accuracy is 91.25%\n",
"INFO:mlp.optimisers:Epoch 48: Took 10 seconds. Training speed 279 pps. Validation speed 1672 pps.\n",
"INFO:mlp.optimisers:Epoch 49: Training cost (ce) is 0.597. Accuracy is 91.70%\n",
"INFO:mlp.optimisers:Epoch 49: Validation cost (ce) is 0.794. Accuracy is 91.60%\n",
"INFO:mlp.optimisers:Epoch 49: Took 9 seconds. Training speed 285 pps. Validation speed 1698 pps.\n",
"INFO:mlp.optimisers:Epoch 50: Training cost (ce) is 0.472. Accuracy is 93.30%\n",
"INFO:mlp.optimisers:Epoch 50: Validation cost (ce) is 0.918. Accuracy is 90.65%\n",
"INFO:mlp.optimisers:Epoch 50: Took 9 seconds. Training speed 303 pps. Validation speed 1672 pps.\n",
"INFO:root:Testing the model on test set:\n",
"INFO:root:MNIST test set accuracy is 90.79 %, cost (ce) is 0.898\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
"INFO:mlp.optimisers:Epoch 1: Training cost (ce) is 3.491. Accuracy is 47.90%\n",
"INFO:mlp.optimisers:Epoch 1: Validation cost (ce) is 0.969. Accuracy is 65.87%\n",
"INFO:mlp.optimisers:Epoch 1: Took 11 seconds. Training speed 220 pps. Validation speed 1466 pps.\n",
"INFO:mlp.optimisers:Epoch 2: Training cost (ce) is 1.039. Accuracy is 66.50%\n",
"INFO:mlp.optimisers:Epoch 2: Validation cost (ce) is 0.494. Accuracy is 85.09%\n",
"INFO:mlp.optimisers:Epoch 2: Took 11 seconds. Training speed 216 pps. Validation speed 1506 pps.\n",
"INFO:mlp.optimisers:Epoch 3: Training cost (ce) is 0.788. Accuracy is 76.10%\n",
"INFO:mlp.optimisers:Epoch 3: Validation cost (ce) is 0.429. Accuracy is 87.25%\n",
"INFO:mlp.optimisers:Epoch 3: Took 12 seconds. Training speed 205 pps. Validation speed 1484 pps.\n",
"INFO:mlp.optimisers:Epoch 4: Training cost (ce) is 0.770. Accuracy is 76.20%\n",
"INFO:mlp.optimisers:Epoch 4: Validation cost (ce) is 0.401. Accuracy is 88.32%\n",
"INFO:mlp.optimisers:Epoch 4: Took 10 seconds. Training speed 291 pps. Validation speed 1471 pps.\n",
"INFO:mlp.optimisers:Epoch 5: Training cost (ce) is 0.667. Accuracy is 79.10%\n",
"INFO:mlp.optimisers:Epoch 5: Validation cost (ce) is 0.440. Accuracy is 87.54%\n",
"INFO:mlp.optimisers:Epoch 5: Took 11 seconds. Training speed 263 pps. Validation speed 1411 pps.\n",
"INFO:mlp.optimisers:Epoch 6: Training cost (ce) is 0.687. Accuracy is 80.80%\n",
"INFO:mlp.optimisers:Epoch 6: Validation cost (ce) is 0.427. Accuracy is 88.10%\n",
"INFO:mlp.optimisers:Epoch 6: Took 11 seconds. Training speed 209 pps. Validation speed 1541 pps.\n",
"INFO:mlp.optimisers:Epoch 7: Training cost (ce) is 0.624. Accuracy is 82.50%\n",
"INFO:mlp.optimisers:Epoch 7: Validation cost (ce) is 0.412. Accuracy is 88.51%\n",
"INFO:mlp.optimisers:Epoch 7: Took 12 seconds. Training speed 194 pps. Validation speed 1546 pps.\n",
"INFO:mlp.optimisers:Epoch 8: Training cost (ce) is 0.581. Accuracy is 82.90%\n",
"INFO:mlp.optimisers:Epoch 8: Validation cost (ce) is 0.436. Accuracy is 87.98%\n",
"INFO:mlp.optimisers:Epoch 8: Took 12 seconds. Training speed 233 pps. Validation speed 1335 pps.\n",
"INFO:mlp.optimisers:Epoch 9: Training cost (ce) is 0.509. Accuracy is 83.30%\n",
"INFO:mlp.optimisers:Epoch 9: Validation cost (ce) is 0.382. Accuracy is 89.88%\n",
"INFO:mlp.optimisers:Epoch 9: Took 11 seconds. Training speed 245 pps. Validation speed 1458 pps.\n",
"INFO:mlp.optimisers:Epoch 10: Training cost (ce) is 0.488. Accuracy is 84.70%\n",
"INFO:mlp.optimisers:Epoch 10: Validation cost (ce) is 0.404. Accuracy is 89.79%\n",
"INFO:mlp.optimisers:Epoch 10: Took 12 seconds. Training speed 191 pps. Validation speed 1506 pps.\n",
"INFO:mlp.optimisers:Epoch 11: Training cost (ce) is 0.516. Accuracy is 84.60%\n",
"INFO:mlp.optimisers:Epoch 11: Validation cost (ce) is 0.394. Accuracy is 89.56%\n",
"INFO:mlp.optimisers:Epoch 11: Took 10 seconds. Training speed 288 pps. Validation speed 1551 pps.\n",
"INFO:mlp.optimisers:Epoch 12: Training cost (ce) is 0.414. Accuracy is 86.80%\n",
"INFO:mlp.optimisers:Epoch 12: Validation cost (ce) is 0.419. Accuracy is 89.70%\n",
"INFO:mlp.optimisers:Epoch 12: Took 10 seconds. Training speed 286 pps. Validation speed 1486 pps.\n",
"INFO:mlp.optimisers:Epoch 13: Training cost (ce) is 0.520. Accuracy is 85.50%\n",
"INFO:mlp.optimisers:Epoch 13: Validation cost (ce) is 0.482. Accuracy is 88.08%\n",
"INFO:mlp.optimisers:Epoch 13: Took 12 seconds. Training speed 204 pps. Validation speed 1515 pps.\n",
"INFO:mlp.optimisers:Epoch 14: Training cost (ce) is 0.423. Accuracy is 87.70%\n",
"INFO:mlp.optimisers:Epoch 14: Validation cost (ce) is 0.412. Accuracy is 89.93%\n",
"INFO:mlp.optimisers:Epoch 14: Took 11 seconds. Training speed 229 pps. Validation speed 1525 pps.\n"
]
}
],

View File

@ -114,11 +114,13 @@ class MLP(object):
d_inp = self.rng.binomial(1, p_inp, size=x.shape)
self.activations[0] = p_inp_scaler*d_inp*x
for i in xrange(0, len(self.layers)):
self.activations[1] = self.layers[0].fprop(self.activations[0])
for i in xrange(1, len(self.layers)):
d_hid = 1
if p_hid < 1 and i > 0:
if p_hid < 1:
d_hid = self.rng.binomial(1, p_hid, size=self.activations[i].shape)
self.activations[i+1] = self.layers[i].fprop(p_hid_scaler*d_hid*self.activations[i])
self.activations[i] = p_hid_scaler*d_hid*self.activations[i]
self.activations[i+1] = self.layers[i].fprop(self.activations[i])
return self.activations[-1]