Skip to content

Instantly share code, notes, and snippets.

@Qwlouse
Created October 1, 2015 20:45
Show Gist options
  • Save Qwlouse/edc58050a2357d6f7d46 to your computer and use it in GitHub Desktop.
Save Qwlouse/edc58050a2357d6f7d46 to your computer and use it in GitHub Desktop.
Demo Notebook for the TA Session from 30.10.2015
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\n",
"from matplotlib import pyplot as plt\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"a = np.array([1, 2, 3, 2, 4])"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7f423c9d7ef0>]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEACAYAAABI5zaHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGCxJREFUeJzt3X+sZHV9//HnG1jiD6KEku+K7DbYsLTyrVakoQSoDDZY\nd21WUdMvCYZiapfQpdUvlRipXZbEFMWWUpYiEKHhxzcQxS5ZfkpKGVK26U1ad9F6dxFqvwQhIg0C\nF1diKe/+MXP1MnvvnTN3zplzZub5SG6ce+ezM2+Ou+/7uee8zvtGZiJJmiwH1F2AJKl8NndJmkA2\nd0maQDZ3SZpANndJmkA2d0maQIWae0QcGBG7IuLOJZ6/MiIei4hHIuK4ckuUJA2q6M79k8AssF8o\nPiI2AEdn5jpgE/Dl8sqTJK1E3+YeEWuADcBXgFhkyUbgRoDMnAEOjYjVZRYpSRpMkZ37XwEXAq8u\n8fyRwJMLPv8+sGbIuiRJQ1i2uUfE7wA/zMxdLL5r/9nSns+daSBJNTqoz/MnARu759VfB7wpIm7K\nzL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Da6Egtp\nwrHsqynHMiJWAV8HbsnMxf4BN+J49quzKcdzQT0vAHcDv97zVCOO57yl6mzA8TwJ2BgR/wHcCrw3\nIm7qWTPwsSy7uf8LsC4ijoqIg4H/Q+cmp4V2AGcDLHfTU8X61hkRqyM6o80i4gQ6sdHFztXVqQnH\nsq8mHMvu+18PzGbmFUssq/14FqmzIcfz8Ig4tPv49cDpwK6eZU04nn3rrPt4ZuZFmbk2M98GnAn8\nQ2ae3bNs4GNZ6i/ryMxXIuJ84Bt0Llxcn5l7IuLc7vONuOmpSJ3AR4HzIuIVYB+dgz5SMSY3kPWr\nkwYcS+Bk4GPAtyJi/h/3RcAvztfZkOPZt06acTyPAG6MiAPobBJvzswHmvZvvUidNON4LpQAwx5L\nb2KSpAlU+k1MkqT62dwlaQLZ3CVpAtncJWkC2dwlaQLZ3CVpAtncJWkC2dwlaQL9D5O6MVDX/LYQ\nAAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f423ea628d0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.plot(a)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"x = np.random.randn(100)\n",
"y = np.random.randn(100)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7f423a97f4a8>"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEACAYAAACqOy3+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF1tJREFUeJzt3X2MXGd1x/Hf2ZgVi6iaOoviAkFBlJYGIrMOqlKF1iPB\n7CZRa9isUBuJylBVFkUKNNogE6zWjnAUKFhE8A+YQrIQJf0D18gRYccrlIGuhCJqYhOSAAFRyosI\n3biKiuLWF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+8zsg+pM+nl3Vu+d\nt2HH1t1nn6Sz7v5gocFlIMnxVQw99xXQLZ98SdL7uy3xSuh+o39jtz+tZWYNd2/32zezBO7uzYS7\nPqjIWqnDjs3M3iXpZklvKSSgjI3w2VXFzyWt70i/Sp1WOCJhZi+SdETSA+7+5bLjyYO7P29mX5H0\nJkntfvsUNQrltesebjrpJ0ZmdqOkD0h6m7v/T9nx5Kwqk7L+TdJrzexqM5uU9BeSjpUcExIyM5P0\nOUlPufu9ZceTJTObNrPLuz9PSWpqQL4sahRKZSf9mNkz6nQ29Doavunu7y0xpEyZ2bykT0qalvS8\npMfd/aZyo0rPzG6SdK86nUSfc/eBw7ViYmYPSdop6QpJv5L0D+5+X7lRZcfM3izpG5K+owvlsDvd\nfbm8qLJhZtdKWlKncT0h6Yvu/rFN92ciDwDEiVuqAUCkSOAAECkSOABEigQOAJEigQNApEjgABAp\nEjgARIoEDgCR+n8pjnf7ct6coQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f423ca2f160>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(x, y)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Markup\n",
"other text\n",
"\n",
"$x_i = 12$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Neural Network"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nr_inputs = 2\n",
"nr_examples = 10\n",
"\n",
"X = np.random.randn(nr_inputs, nr_examples)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.collections.PathCollection at 0x7f423a853240>"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACx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X3+pqTX8j5fz6bri4wVN3ABQGLG5aoeAEBJCH4ASAzBDwCJIfgBIDEEPwAkhuAHgMQQ/ACQ\nGIIfABLzf2jaeA1/t1k0AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7f423a895320>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"plt.scatter(X[0], X[1])"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"nr_hid = 5\n",
"\n",
"W = np.random.randn(nr_inputs, nr_hid)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"H = np.dot(X.T, W)"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(10, 5)"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H.shape"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.54452406, -0.5537587 , -0.92271437, 0.96583749, 0.37911714],\n",
" [-0.46361784, 0.91916244, 0.12191831, -0.94046617, -0.86199782],\n",
" [ 0.05754065, -0.95565177, 0.95636015, 0.31133529, 0.93597057],\n",
" [-0.78171908, 0.90999548, 0.97818869, -0.99823641, -0.80032524],\n",
" [-0.49866617, 0.32188822, 0.93460688, -0.94690781, -0.15162181],\n",
" [-0.81700905, -0.22364497, 0.99979299, -0.99880042, 0.47936414],\n",
" [ 0.61247239, -0.58751963, -0.95930993, 0.98239383, 0.39391214],\n",
" [-0.75303432, 0.83243437, 0.98236399, -0.9970919 , -0.67370374],\n",
" [ 0.20072429, 0.96086947, -0.99463016, 0.47837135, -0.95024969],\n",
" [-0.14326874, -0.3438382 , 0.73788608, -0.41585964, 0.34992547]])"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.tanh(H)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"bias = np.array([0, 1, 2, 3, 4])"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(10, 5)"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H.shape"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(5,)"
]
},
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bias.shape"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"bias = bias.reshape(5, 1)"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(10, 5)"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H.shape"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.6105641 , -0.50190986, 0.05760428, -1.04977555, -0.54752928,\n",
" -1.14775518, 0.71286842, -0.97992704, 0.20348713, -0.14426123],\n",
" [ 0.3762138 , 2.58360119, -0.89320304, 2.52749813, 1.33375216,\n",
" 0.77251029, 0.32613026, 2.19601277, 2.95712014, 0.64156114],\n",
" [ 0.39300744, 2.12252783, 3.90143507, 4.25375404, 3.69362115,\n",
" 6.58789325, 0.06281821, 4.3610512 , -0.9587077 , 2.94582278],\n",
" [ 5.02627236, 1.25793063, 3.32202334, -0.51633502, 1.19901612,\n",
" -0.70916693, 5.36190539, -0.26597367, 3.5208702 , 2.55732457],\n",
" [ 4.39902819, 2.69893208, 5.70451065, 2.90048361, 3.8472 ,\n",
" 4.52215839, 4.4164223 , 3.18250575, 2.16565199, 4.36535883]])"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"H.T + bias"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def f(x, w):\n",
" return np.dot(x, w)"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"x = np.random.randn(5)"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"w = np.random.randn(5, 3)"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"array([-0.24408677, 1.17294168, 1.69420828])"
]
},
"execution_count": 56,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(x, w)"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def E(h):\n",
" return np.sum(h)"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"e= E(f(x, w))"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"epsilon = 1e-5\n",
"w2 = w.copy()\n",
"w2[0,0] = w[0, 0] + epsilon"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"e2 = E(f(x, w2))"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0.47638558524631941"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(e2 - e)/ epsilon"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"gradient = np.zeros((5, 3))"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"gradient[0, 0] = (e2 - e)/ epsilon"
]
},
{
"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.0"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment