Created
August 13, 2015 08:55
-
-
Save matael/649476f8731b521a4495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Populating the interactive namespace from numpy and matplotlib\n" | |
] | |
} | |
], | |
"source": [ | |
"%pylab inline\n", | |
"from matplotlib import pyplot as plt" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"A Neural Network in 11 lines of Python\n", | |
"======================================\n", | |
"\n", | |
"From http://iamtrask.github.io/2015/07/12/basic-python-network/" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Simple 2 Layers NN\n", | |
"----------------" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Output After Training:\n", | |
"[[ 0.00966449]\n", | |
" [ 0.00786506]\n", | |
" [ 0.99358898]\n", | |
" [ 0.99211957]]\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEKCAYAAAAW8vJGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucnGV99/HPN9kkCyQBQSCAQDgVFB+pqBioLwnHRKLQ\nasFHoAKKSlsCIlYoBxMEbLD2QOKBRxQELVSkVYOLJByyplR8hFbAQ6J2IeGYcJAYQrJJNvvrH/c9\nmcPO7M7ubOaew/f9ek125z7M/ObayX3d11kRgZmZWc6YrAMwM7PG4ozBzMyKOGMwM7MizhjMzKyI\nMwYzMy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Uoekn0u6K+tYsiRphaT+\n9LGp0nFNlzEMMWiu3dwAVFwzo81sB9wOTAWOAy6W9OZMI8pOrgp3F+CtwPslvTPbkDJ3EfALksbX\ndhbALhExJiLGVzqo6TIGBhk0124i4iGSZVDbXkSsjIjbI2JNRCwHHiZZz6PtRER/RDweEZtI1lDf\nQn4t9baTLgVwPHATxR1d2tWQ1/1mzBhGMmjO2oikvUk6RjyUdSxZSatO+oHngHsi4uGsY8rQ9cDF\nuLSQ0yPp+bRHaVnNmDH4j2sVSXodcCdJb7berOPJSkT0RcQYYH/gXZIOzTqmLEg6FfifdAVIlxbg\nPcBuwDHAhySVrYpuxoyhdB3p/YFnKhzbDpxRpiRNAn5IMofXg1nH0wgiYgVwHzAz41CychRwUVp6\negCYJWlxxjFlJiKWR8SmtLr1uySTlQ7QjBnD1kFzkvYlaYRemHFMWfJdECCpk+R7cGtEfC/reLIk\naR9Jb5PUKelg4APAsqzjykJEXJQ2tI4huUvuioi2nMo/XSrh8PR7cQhwKsks1wM0XcYw2KC5diPp\nPpLZZw9Nu59dkHVMGZoGHA18taA73ulZB5WR7YEbgd+TlBbuiIi7sw2pYbRzCXsiyaDhV4DFwC0R\ncX+5Az3AzczMijRdicHMzLYtZwxmZlbEGYOZmRVxxmBmZkWcMZiZWRFnDGZmVsQZg5mZFXHGYGZm\nRf4XKcjyvGi2Xw4AAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f10ecbcd748>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"import numpy as np\n", | |
"\n", | |
"# sigmoid function\n", | |
"def nonlin(x,deriv=False):\n", | |
" if(deriv==True):\n", | |
" return x*(1-x)\n", | |
" return 1/(1+np.exp(-x))\n", | |
" \n", | |
"# input dataset\n", | |
"X = np.array([ [0,0,1],\n", | |
" [0,1,1],\n", | |
" [1,0,1],\n", | |
" [1,1,1] ])\n", | |
" \n", | |
"# output dataset \n", | |
"y = np.array([[0,0,1,1]]).T\n", | |
"\n", | |
"# seed random numbers to make calculation\n", | |
"# deterministic (just a good practice)\n", | |
"np.random.seed(1)\n", | |
"\n", | |
"# initialize weights randomly with mean 0\n", | |
"syn0 = 2*np.random.random((3,1)) - 1\n", | |
"\n", | |
"plt.subplot(211)\n", | |
"\n", | |
"for iter in range(10000):\n", | |
"\n", | |
" # forward propagation\n", | |
" l0 = X\n", | |
" l1 = nonlin(np.dot(l0,syn0))\n", | |
"\n", | |
" # how much did we miss?\n", | |
" l1_error = y - l1\n", | |
"\n", | |
" # multiply how much we missed by the \n", | |
" # slope of the sigmoid at the values in l1\n", | |
" l1_delta = l1_error * nonlin(l1,True)\n", | |
"\n", | |
" # update weights\n", | |
" syn0 += np.dot(l0.T,l1_delta)\n", | |
" \n", | |
" plt.plot(range(1,5), l1, 'ob')\n", | |
" plt.hold(True)\n", | |
"\n", | |
"\n", | |
"print(\"Output After Training:\")\n", | |
"print(l1)\n", | |
"\n", | |
"plt.plot(range(1,5), y, 'or')\n", | |
"plt.xlim([0, 5])\n", | |
"plt.title(\"Evolution of l1 through iterations\")\n", | |
"plt.subplot(212)\n", | |
"plt.stem(range(1,5), y-l1)\n", | |
"plt.xlim([0,5])\n", | |
"plt.show()\n", | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"It works pretty well, let's now see how this simple implementation converges with respect to the number of iterations for the training.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"OO implementation\n", | |
"---------------" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"class TwoLayersNN:\n", | |
" \n", | |
" def __init__(self, in_data, out_data):\n", | |
" \n", | |
" self.in_data = in_data\n", | |
" self.out_data = out_data\n", | |
" \n", | |
" self._init_synapses()\n", | |
" \n", | |
" def _init_synapses(self):\n", | |
" \n", | |
" self.syn0 = 2*np.random.random((len(self.in_data[0]), len(self.out_data[0]))) - 1\n", | |
" self.trained = False\n", | |
" \n", | |
" \n", | |
" def NL(self, x, deriv=False):\n", | |
" \n", | |
" if(deriv==True):\n", | |
" return x*(1-x)\n", | |
" return 1/(1+np.exp(-x))\n", | |
" \n", | |
" def train(self, iter_nb=10000):\n", | |
" \n", | |
" if self.trained:\n", | |
" self._init_synapses()\n", | |
" \n", | |
" for iter in range(iter_nb):\n", | |
" \n", | |
" l0 = self.in_data\n", | |
" l1 = self.NL(np.dot(l0, self.syn0))\n", | |
" \n", | |
" l1_error = self.out_data - l1\n", | |
" l1_delta = l1_error*self.NL(l1, True)\n", | |
" \n", | |
" self.syn0 += np.dot(l0.T, l1_delta)\n", | |
" \n", | |
" self.trained = True\n", | |
" return self.syn0\n", | |
" \n", | |
" def test(self, in_data, batch=True):\n", | |
" \n", | |
" if not batch:\n", | |
" in_data = [in_data]\n", | |
" \n", | |
" return self.NL(np.dot(in_data, self.syn0))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Convergence Study\n", | |
"---------------" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Training on 1 iterations\n", | |
"Training on 201 iterations\n", | |
"Training on 401 iterations\n", | |
"Training on 601 iterations\n", | |
"Training on 801 iterations\n", | |
"Training on 1001 iterations\n", | |
"Training on 1201 iterations\n", | |
"Training on 1401 iterations\n", | |
"Training on 1601 iterations\n", | |
"Training on 1801 iterations\n", | |
"Training on 2001 iterations\n", | |
"Training on 2201 iterations\n", | |
"Training on 2401 iterations\n", | |
"Training on 2601 iterations\n", | |
"Training on 2801 iterations\n", | |
"Training on 3001 iterations\n", | |
"Training on 3201 iterations\n", | |
"Training on 3401 iterations\n", | |
"Training on 3601 iterations\n", | |
"Training on 3801 iterations\n", | |
"Training on 4001 iterations\n", | |
"Training on 4201 iterations\n", | |
"Training on 4401 iterations\n", | |
"Training on 4601 iterations\n", | |
"Training on 4801 iterations\n", | |
"Training on 5001 iterations\n", | |
"Training on 5201 iterations\n", | |
"Training on 5401 iterations\n", | |
"Training on 5601 iterations\n", | |
"Training on 5801 iterations\n", | |
"Training on 6001 iterations\n", | |
"Training on 6201 iterations\n", | |
"Training on 6401 iterations\n", | |
"Training on 6601 iterations\n", | |
"Training on 6801 iterations\n", | |
"Training on 7001 iterations\n", | |
"Training on 7201 iterations\n", | |
"Training on 7401 iterations\n", | |
"Training on 7601 iterations\n", | |
"Training on 7801 iterations\n", | |
"Training on 8001 iterations\n", | |
"Training on 8201 iterations\n", | |
"Training on 8401 iterations\n", | |
"Training on 8601 iterations\n", | |
"Training on 8801 iterations\n", | |
"Training on 9001 iterations\n", | |
"Training on 9201 iterations\n", | |
"Training on 9401 iterations\n", | |
"Training on 9601 iterations\n", | |
"Training on 9801 iterations\n", | |
"Training on 10001 iterations\n", | |
"Training on 10201 iterations\n", | |
"Training on 10401 iterations\n", | |
"Training on 10601 iterations\n", | |
"Training on 10801 iterations\n", | |
"Training on 11001 iterations\n", | |
"Training on 11201 iterations\n", | |
"Training on 11401 iterations\n", | |
"Training on 11601 iterations\n", | |
"Training on 11801 iterations\n", | |
"Training on 12001 iterations\n", | |
"Training on 12201 iterations\n", | |
"Training on 12401 iterations\n", | |
"Training on 12601 iterations\n", | |
"Training on 12801 iterations\n", | |
"Training on 13001 iterations\n", | |
"Training on 13201 iterations\n", | |
"Training on 13401 iterations\n", | |
"Training on 13601 iterations\n", | |
"Training on 13801 iterations\n", | |
"Training on 14001 iterations\n", | |
"Training on 14201 iterations\n", | |
"Training on 14401 iterations\n", | |
"Training on 14601 iterations\n", | |
"Training on 14801 iterations\n", | |
"Training on 15001 iterations\n", | |
"Training on 15201 iterations\n", | |
"Training on 15401 iterations\n", | |
"Training on 15601 iterations\n", | |
"Training on 15801 iterations\n", | |
"Training on 16001 iterations\n", | |
"Training on 16201 iterations\n", | |
"Training on 16401 iterations\n", | |
"Training on 16601 iterations\n", | |
"Training on 16801 iterations\n", | |
"Training on 17001 iterations\n", | |
"Training on 17201 iterations\n", | |
"Training on 17401 iterations\n", | |
"Training on 17601 iterations\n", | |
"Training on 17801 iterations\n", | |
"Training on 18001 iterations\n", | |
"Training on 18201 iterations\n", | |
"Training on 18401 iterations\n", | |
"Training on 18601 iterations\n", | |
"Training on 18801 iterations\n", | |
"Training on 19001 iterations\n", | |
"Training on 19201 iterations\n", | |
"Training on 19401 iterations\n", | |
"Training on 19601 iterations\n", | |
"Training on 19801 iterations\n" | |
] | |
} | |
], | |
"source": [ | |
"import numpy as np\n", | |
"\n", | |
"np.random.seed(1)\n", | |
"\n", | |
"# input dataset\n", | |
"X = np.array([ [0,0,1],\n", | |
" [0,1,1],\n", | |
" [1,0,1],\n", | |
" [1,1,1] ])\n", | |
" \n", | |
"# output dataset \n", | |
"y = np.array([[0,0,1,1]]).T\n", | |
"\n", | |
"iterations_numbers = list(range(1, 20000, 200))\n", | |
"results = []\n", | |
"\n", | |
"\n", | |
"NN = TwoLayersNN(X, y)\n", | |
"\n", | |
"for it in iterations_numbers:\n", | |
" print('Training on {} iterations'.format(it))\n", | |
" NN.train(it)\n", | |
" guesses = NN.test(X)\n", | |
" results.append(np.mean(np.power(np.abs(y - guesses), 2)))\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEWCAYAAACe8xtsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xu8VGXZ//HPBZinUB7h10HqcYNa+CiKmngq24IgHtC0\nTK0IBFLQB1BLqVcoe3tKzITQ8JzbYyqlJ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AnYSi9xrwiej1uPtrhJbC2migPvt9c4A1hOI7\nE/iSu7/bwe/nQE9CrtcRutKm5fB7SR3Reh4iIpI3tTxERCRvKh4iIpI3FQ8REcmbioeIiORNxUNE\nRPKm4iEiInlT8RARkbz9HzlzZSeDdKFEAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f10e63ba978>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.loglog(iterations_numbers, results)\n", | |
"plt.xlabel('Number of iterations')\n", | |
"plt.ylabel('Error |y - l1|^2')\n", | |
"plt.grid(True)\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### So what ?\n", | |
"\n", | |
"There's clearly 2 zones on the convergence diagram. An **interesting track** could be to **figure out why**.\n", | |
"\n", | |
"Another track leads to an analysis of the position of the bend : does it move ? Is it stable with respect to iterations ? to error order of magnitude ?\n", | |
"\n", | |
"Finnaly, it's possible to train a network and stop when overall $\\mathbb{L}_2$ error is below a *goal error*.\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Stability of the slope singular point\n", | |
"\n", | |
"To be tested on different re-trained NN but also on a single n-times re-trained NN." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# Let's re-use the above show code into a function\n", | |
"# so one can re-run the same experiment multiple times\n", | |
"\n", | |
"\n", | |
"def slope_singularity_exp(iterations_numbers, NN=None):\n", | |
" \"\"\"\n", | |
" Re-train the same NN for different numbers of training iterations.\n", | |
" Store and return the mean L2 distance between guesses and expected output\n", | |
" \n", | |
" If a NN instance is passed as a parameter, this network will be used \n", | |
" instead of creating a new one.\n", | |
" \"\"\"\n", | |
"\n", | |
" if not NN:\n", | |
" NN = TwoLayersNN(X, y)\n", | |
"\n", | |
" results = []\n", | |
" for it in iterations_numbers:\n", | |
" NN.train(it)\n", | |
" guesses = NN.test(X)\n", | |
" results.append(np.mean(np.power(np.abs(y - guesses), 2)))\n", | |
"\n", | |
" return results" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Different NN" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Running experiment no.0\n", | |
"Running experiment no.1\n", | |
"Running experiment no.2\n", | |
"Running experiment no.3\n", | |
"Running experiment no.4\n" | |
] | |
} | |
], | |
"source": [ | |
"iterations_numbers = list(range(1, 20000, 250))\n", | |
"\n", | |
"global_results = []\n", | |
"\n", | |
"for i in range(5):\n", | |
" print(\"Running experiment no.{}\".format(i))\n", | |
" global_results.append(slope_singularity_exp(iterations_numbers))\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false, | |
"scrolled": true | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEWCAYAAACe8xtsAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVNX7wPHPA+4r4q6oLOZSaq6UlUW5pFlZ2bftq2ml\naZZLVpplqa2almZlWln4q8z2TNstMS0Ll1xyF0RFUXFBEUW28/tjBi7yVWFgmDsMz/v14iX3zsy9\nzzyvcR7OOfeeI8YYlFJKKVf42R2AUkqpkkeLh1JKKZdp8VBKKeUyLR5KKaVcpsVDKaWUy7R4KKWU\ncpkWD6WUUi7T4qGUUsplZewO4HxEpDIwCzgDRBlj5tscklJKKSdvbnncBnxmjHkQuNnuYJRSSlk8\nWjxEZJ6IHBSRjXn29xSRPSKSJCJjnbsbAnudv2d6Mk6llFIX5umWx2y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K6nodSSimXactDKaWUy7R4KKWUcpkWD6WUUi7T4qGUUsplWjyU\nUkq5TIuHUkopl2nxUEop5bL/B2JT4KpNCZIRAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f10e635e2b0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.figure()\n", | |
"plt.hold(True)\n", | |
"for res in global_results:\n", | |
" plt.loglog(iterations_numbers, res)\n", | |
"\n", | |
"plt.grid(True)\n", | |
"plt.xlabel(\"Number of iterations\")\n", | |
"plt.ylabel(\"Error as |y-l1|^2\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"It seems that different NN of the same type exhibit a bend at the same point. What's interesting in this point is that we now can infer the explanation for this bend point can be found in the underlying maths.\n", | |
"\n", | |
"At low numbers of training iterations, the results are slightly dispersed. This issue may be unseen using only one single NN." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"### Single NN" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Running experiment no.0\n", | |
"Running experiment no.1\n", | |
"Running experiment no.2\n", | |
"Running experiment no.3\n", | |
"Running experiment no.4\n" | |
] | |
} | |
], | |
"source": [ | |
"NN = TwoLayersNN(X,y)\n", | |
"iterations_numbers = list(range(1, 20000, 250))\n", | |
"\n", | |
"global_results = []\n", | |
"\n", | |
"for i in range(5):\n", | |
" print(\"Running experiment no.{}\".format(i))\n", | |
" global_results.append(slope_singularity_exp(iterations_numbers, NN))\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoA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CQiFXB03fi6uFsBHhSRGs7nGVwCbAN+BF4QkfoiUlFEeopIpYvsazVwvYhcKiK1\ngUdx7fGuJ4B6IpL9//BH4GURqS4iQSJye46YcyoLnAbOiEg/oL5z/UmgmoiUz+NYvwJPOvfbA0fr\nYlse+wYQEQkWkQ7AJmAxjlaRUmdp8VDeKOdf7G8C1XMsT8XRzXQQR6vj5Hnel3t/Jsfvv+F4IE4k\nMMAYkwZMA1YCq3A8Ve2xHO/Lc7/GmAM4xlG+xfElu9QYM9+F8/sZx7jCGREZhKMr6jiwFcd4xn/y\niB/gMxxF7zDQ0bk9xpjDOFoKic6B+pzvmwwcwVF8JwL3GWPSz3N+BqiEI9dJOLrSRubjvFQpos/z\nUEop5TJteSillHKZFg+llFIu0+KhlFLKZVo8lFJKuUyLh1JKKZdp8VBKKeUyLR5KKaVc9v9Mp9bI\nA9tOqgAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f10e53034a8>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.figure()\n", | |
"plt.hold(True)\n", | |
"for res in global_results:\n", | |
" plt.loglog(iterations_numbers, res)\n", | |
"\n", | |
"plt.grid(True)\n", | |
"plt.xlabel(\"Number of iterations\")\n", | |
"plt.ylabel(\"Error as |y-l1|^2\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The hypothesis that using a single NN instead of one per run would reduce dispersion at low training iterations numbers isn't verified. The second (and better) hypothesis is that this dispersion is only related to the random initialization of synapses... it seems plausible but the deviation is quite big though....\n", | |
"\n", | |
"To answer the questions above : the bend point seems stable with respect to number of iterations and error, no matter if we use one or several NN. $\\Leftarrow$ **Answer lies in maths**\n", | |
"\n", | |
"The second goal was to implement an error controled training process : let's modify the TwoLayersNN class." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"class TwoLayersNN:\n", | |
" \n", | |
" def __init__(self, in_data, out_data):\n", | |
" \n", | |
" self.in_data = in_data\n", | |
" self.out_data = out_data\n", | |
" \n", | |
" self._init_synapses()\n", | |
" \n", | |
" def _init_synapses(self):\n", | |
" \n", | |
" self.syn0 = 2*np.random.random((len(self.in_data[0]), len(self.out_data[0]))) - 1\n", | |
" self.trained = False\n", | |
" \n", | |
" \n", | |
" def NL(self, x, deriv=False):\n", | |
" \n", | |
" if(deriv==True):\n", | |
" return x*(1-x)\n", | |
" return 1/(1+np.exp(-x))\n", | |
" \n", | |
" def train(self, condition=lambda _: False, verbose=False):\n", | |
" \n", | |
" if self.trained:\n", | |
" self._init_synapses()\n", | |
" \n", | |
" self.training_iter = 0\n", | |
" while condition(self):\n", | |
" if verbose: print('Counter : {}'.format(self.training_iter))\n", | |
" l0 = self.in_data\n", | |
" l1 = self.NL(np.dot(l0, self.syn0))\n", | |
" \n", | |
" l1_error = self.out_data - l1\n", | |
" l1_delta = l1_error*self.NL(l1, True)\n", | |
" \n", | |
" self.syn0 += np.dot(l0.T, l1_delta)\n", | |
" \n", | |
" self.training_iter += 1\n", | |
" \n", | |
" self.trained = True\n", | |
" return self.syn0\n", | |
" \n", | |
" def train_iter(self, iter_nb):\n", | |
" self.train(lambda x: x.training_iter < iter_nb)\n", | |
" \n", | |
" def train_error(self, goal_error, *a, **kw):\n", | |
" self.train(lambda s: (s.training_iter < 10000) or (np.mean(np.power(np.abs(self.out_data- s.test(self.in_data)), 2)) > goal_error), *a, **kw)\n", | |
" \n", | |
" def test(self, in_data, batch=True):\n", | |
" \n", | |
" if not batch:\n", | |
" in_data = [in_data]\n", | |
" \n", | |
" return self.NL(np.dot(in_data, self.syn0))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Mean error : 9.999868933361674e-06\n" | |
] | |
} | |
], | |
"source": [ | |
"NN = TwoLayersNN(X,y)\n", | |
"NN.train_error(1e-5)\n", | |
"mean_error = np.mean(np.power(np.abs(y- NN.test(X)), 2))\n", | |
"\n", | |
"print('Mean error : {}'.format(mean_error))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"3 Layers NN\n", | |
"----------" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Error:0.496410031903\n", | |
"Error:0.00858452565325\n", | |
"Error:0.00578945986251\n", | |
"Error:0.00462917677677\n", | |
"Error:0.00395876528027\n", | |
"Error:0.00351012256786\n" | |
] | |
} | |
], | |
"source": [ | |
"import numpy as np\n", | |
"\n", | |
"def nonlin(x,deriv=False):\n", | |
"\tif(deriv==True):\n", | |
"\t return x*(1-x)\n", | |
"\treturn 1/(1+np.exp(-x))\n", | |
" \n", | |
"X = np.array([\n", | |
" [0,0,1],\n", | |
" [0,1,1],\n", | |
" [1,0,1],\n", | |
" [1,1,1]\n", | |
"])\n", | |
" \n", | |
"y = np.array([\n", | |
" [0],\n", | |
"\t[1],\n", | |
"\t[1],\n", | |
"\t[0]\n", | |
"])\n", | |
"\n", | |
"np.random.seed(1)\n", | |
"\n", | |
"# randomly initialize our weights with mean 0\n", | |
"syn0 = 2*np.random.random((3,4)) - 1\n", | |
"syn1 = 2*np.random.random((4,1)) - 1\n", | |
"\n", | |
"for j in range(60000):\n", | |
"\n", | |
"\t# Feed forward through layers 0, 1, and 2\n", | |
" l0 = X\n", | |
" l1 = nonlin(np.dot(l0,syn0))\n", | |
" l2 = nonlin(np.dot(l1,syn1))\n", | |
"\n", | |
" # how much did we miss the target value?\n", | |
" l2_error = y - l2\n", | |
" \n", | |
" if (j% 10000) == 0:\n", | |
" print(\"Error:\" + str(np.mean(np.abs(l2_error))))\n", | |
" \n", | |
" # in what direction is the target value?\n", | |
" # were we really sure? if so, don't change too much.\n", | |
" l2_delta = l2_error*nonlin(l2,deriv=True)\n", | |
"\n", | |
" # how much did each l1 value contribute to the l2 error (according to the weights)?\n", | |
" l1_error = l2_delta.dot(syn1.T)\n", | |
" \n", | |
" # in what direction is the target l1?\n", | |
" # were we really sure? if so, don't change too much.\n", | |
" l1_delta = l1_error * nonlin(l1,deriv=True)\n", | |
"\n", | |
" syn1 += l1.T.dot(l2_delta)\n", | |
" syn0 += l0.T.dot(l1_delta)\n", | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"1" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"np.abs(-1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.4.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment