Skip to content

Commit

Permalink
Lisa-lab code path fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kimeunsol committed Apr 15, 2016
1 parent feb9ba8 commit 394cdbb
Showing 1 changed file with 22 additions and 41 deletions.
63 changes: 22 additions & 41 deletions CNN with MNIST.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand All @@ -13,7 +13,7 @@
"import timeit\n",
"\n",
"import numpy \n",
"deep_root = 'DeepLearningTutorials/'\n",
"deep_root = '../DeepLearningTutorials/'\n",
"sys.path.insert(0, os.path.join(deep_root,'code'))\n",
"\n",
"import theano\n",
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"metadata": {
"collapsed": true
},
Expand All @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"collapsed": true
},
Expand All @@ -62,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 5,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand All @@ -115,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -126,7 +126,7 @@
"<TensorType(int32, vector)>"
]
},
"execution_count": 17,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 8,
"metadata": {
"collapsed": false,
"scrolled": true
Expand All @@ -149,38 +149,19 @@
"text": [
"... building the model\n",
"... training\n",
"training @ iter = 0\n",
"epoch 1, minibatch 100/100, validation error 8.500000 %\n",
" epoch 1, minibatch 100/100, test error of best model 8.910000 %\n",
"training @ iter = 100\n",
"epoch 2, minibatch 100/100, validation error 5.840000 %\n",
" epoch 2, minibatch 100/100, test error of best model 6.130000 %\n",
"training @ iter = 200\n",
"epoch 3, minibatch 100/100, validation error 4.310000 %\n",
" epoch 3, minibatch 100/100, test error of best model 4.700000 %\n",
"training @ iter = 300\n",
"epoch 4, minibatch 100/100, validation error 3.510000 %\n",
" epoch 4, minibatch 100/100, test error of best model 3.610000 %\n",
"training @ iter = 400\n",
"epoch 5, minibatch 100/100, validation error 2.960000 %\n",
" epoch 5, minibatch 100/100, test error of best model 3.090000 %\n",
"training @ iter = 500\n",
"epoch 6, minibatch 100/100, validation error 2.670000 %\n",
" epoch 6, minibatch 100/100, test error of best model 2.750000 %\n",
"training @ iter = 600\n",
"epoch 7, minibatch 100/100, validation error 2.410000 %\n",
" epoch 7, minibatch 100/100, test error of best model 2.410000 %\n",
"training @ iter = 700\n",
"epoch 8, minibatch 100/100, validation error 2.300000 %\n",
" epoch 8, minibatch 100/100, test error of best model 2.200000 %\n",
"training @ iter = 800\n",
"epoch 9, minibatch 100/100, validation error 2.230000 %\n",
" epoch 9, minibatch 100/100, test error of best model 2.070000 %\n",
"training @ iter = 900\n",
"epoch 10, minibatch 100/100, validation error 2.030000 %\n",
" epoch 10, minibatch 100/100, test error of best model 1.900000 %\n",
"Optimization complete.\n",
"Best validation score of 2.030000 % obtained at iteration 1000, with test performance 1.900000 %\n"
"training @ iter = 0\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-8-21d5ce3e743f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 162\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0miter\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;36m100\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 163\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m'training @ iter = '\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0miter\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 164\u001b[1;33m \u001b[0mcost_ij\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtrain_model\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mminibatch_index\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 165\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 166\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0miter\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mvalidation_frequency\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;32m/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.pyc\u001b[0m in \u001b[0;36m__call__\u001b[1;34m(self, *args, **kwargs)\u001b[0m\n\u001b[0;32m 857\u001b[0m \u001b[0mt0_fn\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtime\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 858\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 859\u001b[1;33m \u001b[0moutputs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 860\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 861\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfn\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'position_of_error'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mKeyboardInterrupt\u001b[0m: "
]
}
],
Expand Down

0 comments on commit 394cdbb

Please sign in to comment.