임호준

20171010 Practice

{
"cells": [
{
"cell_type": "code",
"execution_count": 62,
"metadata": {},
"outputs": [],
"source": [
"import tensorflow as tf\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"input_x = tf.placeholder(tf.float32, shape=[None])\n",
"label_y = tf.placeholder(tf.float32, shape=[None])\n",
"\n",
"weight = tf.Variable(tf.random_normal(shape=[1]))\n",
"\n",
"\n",
"hypothesis = tf.multiply(input_x, weight)\n",
"loss = tf.reduce_mean(tf.square(hypothesis - label_y))\n",
"optimize = tf.train.GradientDescentOptimizer(learning_rate=0.01).minimize(loss)\n"
]
},
{
"cell_type": "code",
"execution_count": 65,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING:tensorflow:From <ipython-input-65-c15f0cb911e2>:2: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.\n",
"Instructions for updating:\n",
"Use `tf.global_variables_initializer` instead.\n",
"0 [ 1.57790422]\n",
"1 [ 1.52396655]\n",
"2 [ 1.47506297]\n",
"3 [ 1.43072379]\n",
"4 [ 1.39052284]\n",
"5 [ 1.354074]\n",
"6 [ 1.32102704]\n",
"7 [ 1.2910645]\n",
"8 [ 1.26389849]\n",
"9 [ 1.23926795]\n",
"10 [ 1.21693623]\n",
"11 [ 1.19668889]\n",
"12 [ 1.17833126]\n",
"13 [ 1.16168702]\n",
"14 [ 1.14659619]\n",
"15 [ 1.13291383]\n",
"16 [ 1.12050855]\n",
"17 [ 1.10926104]\n",
"18 [ 1.0990634]\n",
"19 [ 1.08981752]\n",
"20 [ 1.08143461]\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEICAYAAACktLTqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHUxJREFUeJzt3Xt8VOWdx/HvV4iIcrMS5Q6teENQQIq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DvMa\nCHdux3lxj80n8plZbfrHJzNbAKCAZPcwHotkAVKT7kUzm9PETXL2vDQ3llw+L95j7ACwGIefPenQ\nc0KyPYCuAD4MaxwBiMXczvXfX1zmdtzmtfc4gc/tOC/ucwHc7L2CPgpZfiJfGEj2SB/nIjkSqect\n8MXDe4xfAyg3s8eOcLOcPC/ZjCUXzwvJQpLdvMsdAVwC4N1GN5sL4Jve5bEAFpn3ClRMxWJu52pe\ne/cfi7kdl3nt3XeoczuIj/xtFYb0iXwhjWUsgFtJ1gP4CMC4kBaP8wHcBGCVdxwOAO4F0C9jLLl6\nXrIZSy6el54AniXZDqlvsplm9grJBwEUm9lcpL5ZnydZgdQLiOMCHkOLxGVux2heA/GZ23GZ10DI\nc1sfPyAi4qA4H5YREZFW0uIuIuIgLe4iIg7S4i4i4iAt7iIiDtLiLiLiIC3uIiIO+n9eoExMfIE/\nDgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1820ef6cf60>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"with tf.Session() as sess:\n",
" sess.run(tf.initialize_all_variables())\n",
" for i in range(0, 21):\n",
" sess.run(optimize, feed_dict={input_x: [1, 2, 3], label_y: [1, 2, 3]})\n",
" print(i, weight.eval())\n",
"\n",
" fig = plt.figure()\n",
" subplot = fig.add_subplot(1, 2, 1)\n",
" subplot.plot([1, 2, 3], hypothesis.eval(feed_dict={input_x: [1, 2, 3]}))\n",
" subplot.set_title(\"testing\")\n",
" subplot = fig.add_subplot(1, 2, 2)\n",
" subplot.plot([1, 2, 3], hypothesis.eval(feed_dict={input_x: [1, 2, 3]}))\n",
"\n",
" plt.show()"
]
}
],
"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.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}