{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import numpy.random as rng\n",
    "import tensorflow as tf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "din = rng.randn(100,1)\n",
    "out = din * .2 + .1+ .1 * rng.normal(size=din.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x10d38ad30>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH+9JREFUeJzt3XuU3GWd5/H3NyR9MZ0LWRvkYrpxEIIrYMJpZVc8FJA4\n0XGU3XGFzHFm1B42yILsjDKJ0R3aZWCBwx42jjpJnIgzczYh4+UI6yIJGbrGw67YvSQRxqQBL2nB\nS7rwEol2IJfv/lFVTXV1XX7V9atf/ap+n9c5daiqfqp+TwHnW099n+f5PubuiIhI+5vT7A6IiEg0\nFPBFRBJCAV9EJCEU8EVEEkIBX0QkIRTwRUQSIpSAb2arzWzMzJ4xs3Ul/r7QzB40s31m9pSZfSCM\n64qISHBW7zp8M5sDPANcBfwEGAWudfexgjYfBxa6+8fN7NXA08Dp7n68rouLiEhgYYzw3ww86+7j\n7n4MuB94T1EbBxbk7i8Afq5gLyISrTAC/lnAcwWPn889V+gzwBvM7CfAd4CbQ7iuiIjUIKpJ298F\n9rr7mcBy4LNm1hPRt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
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(din, out)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6.5261\n",
      "Iteration 0 Loss 0.877566\n",
      "[ 0.21694028]\n",
      "Iteration 1 Loss 0.834038\n",
      "[ 0.22164701]\n",
      "Iteration 2 Loss 0.833522\n",
      "[ 0.22377081]\n",
      "Iteration 3 Loss 0.833514\n",
      "[ 0.2239479]\n",
      "Iteration 4 Loss 0.833514\n",
      "[ 0.22397718]\n",
      "Iteration 5 Loss 0.833514\n",
      "[ 0.22398056]\n",
      "Iteration 6 Loss 0.833515\n",
      "[ 0.22398102]\n",
      "Iteration 7 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 8 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 9 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 10 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 11 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 12 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 13 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 14 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 15 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 16 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 17 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 18 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 19 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 20 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 21 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 22 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 23 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 24 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 25 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 26 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 27 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 28 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 29 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 30 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 31 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 32 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 33 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 34 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 35 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 36 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 37 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 38 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 39 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 40 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 41 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 42 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 43 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 44 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 45 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 46 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 47 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 48 Loss 0.833514\n",
      "[ 0.22398108]\n",
      "Iteration 49 Loss 0.833514\n",
      "[ 0.22398108]\n"
     ]
    }
   ],
   "source": [
    "x = tf.placeholder(np.float32, [None])\n",
    "w = tf.Variable([0.0])\n",
    "b = tf.Variable([0.0])\n",
    "\n",
    "y = tf.mul(x, w) + b\n",
    "\n",
    "y_ = tf.placeholder(\"float\")\n",
    "loss = tf.reduce_sum(tf.pow(y_ - y, 2))\n",
    "\n",
    "init = tf.initialize_all_variables()\n",
    "optim = tf.train.GradientDescentOptimizer(.005).minimize(loss)\n",
    "\n",
    "with tf.Session() as sess:\n",
    "    feed_dict={x: din, y_: out}\n",
    "    sess.run(init)\n",
    "    print(sess.run(loss, feed_dict=feed_dict))\n",
    "    for step in range(50):\n",
    "        sess.run(optim, feed_dict=feed_dict)\n",
    "        cost_curr = sess.run(loss, feed_dict=feed_dict)\n",
    "        print(\"Iteration\", step, \"Loss\", cost_curr)\n",
    "        print(sess.run(w))\n",
    "        \n",
    "    beta = [sess.run(w), sess.run(b)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1118249e8>]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl83FW9//HXp0sWumFp2G0KF6FAWVqs1B+iKRRE7mXR\nq5QKClKhyC0FBGW5KEV2vIq40cVeVJSAAqJSoKW3DYhaGmtLK20AhUSgQKZgKYGkTZvP74+ZtJNk\nlu9k9pn38/GYB5nJme/3DPD4zMnnnPM55u6IiEjpG5DvDoiISG4o4IuIlAkFfBGRMqGALyJSJhTw\nRUTKhAK+iEiZyEjAN7OTzKzJzF4wsytj/H64mf3OzFab2VozOzcT9xURkeAs3XX4ZjYAeAE4HtgA\nNAJnuntTVJurgeHufrWZjQKeB/Zw921p3VxERALLxAj/I8CL7t7i7p3AfcBpvdo4MCzy8zDgLQV7\nEZHcykTA3wd4Jer5q5HXov0QOMTMNgDPApdk4L4iIpKCXE3afhJ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MKOCLiJQJBXwRkTKhgC8iUiYU8EVEysT/B0Jd\nuKKczcRcAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x111824a90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(din, out)\n",
    "x = np.linspace(din.min(), din.max(), 101)\n",
    "plt.plot(x, beta[0] * x + beta[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.22398109,  0.08161766])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.polyfit(din, out ,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.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}