Toggle navigation
Toggle navigation
This project
Loading...
Sign in
임호준
/
M.LClassPractice
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
임호준
2017-10-10 12:22:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6208eda72026cf34a41d6dc975918376ef4cff89
6208eda7
1 parent
7f559008
20171010 Practice
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
0 deletions
Linear Regression2.ipynb
Linear Regression2.ipynb
0 → 100644
View file @
6208eda
{
"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
\n
AAALEgAACxIB0t1+/AAAHUxJREFUeJzt3Xt8VOWdx/HvV4iIcrMS5Q6teENQQIqgrWKtrVov24oV
\n
66Xtbpfq6q5gW7Vuq6hYbburFrBSd7svr8Ug0BYEdVGwl9dWMNBwSWIlKBBoIEEuISCXkN/+MWdw
\n
DOFkkpwz55xnvu/XKy8HZpx5GJ48PDkznzk0M4iIiFuOinoAIiISPC3uIiIO0uIuIuIgLe4iIg7S
\n
4i4i4iAt7iIiDtLinkAkp5P8cdTjEJH4ot7nHh6S6wB8x8zeaMN9fMu7j88FNS4RcZ927iIiDtLi
\n
HhKSzwPoB2AeyTqSd5EcRfL/SO4guYLkmIzbf4vk+yR3kfyA5A0kzwAwHcBo7z52eLd9huRk7/IY
\n
khtJfo9kNckqkt/OuN8TSM4jWUvyHZKTSf45p0+GiOScFveQmNlNADYAuNLMOgF4EcB8AJMBfArA
\n
9wHMJllI8jgAUwBcZmadAZwHoMTMygHcAuAvZtbJzLod4eF6AOgKoDeAfwLwJMnjveueBLDbu803
\n
vS8RcZ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AVwC4N1GN5sL4Jve5bEAFpn3ClRMxWJu52pe
\n
e/cfi7kdl3nt3XeoczuIj/xtFYb0iXwhjWUsgFtJ1gP4CMC4kBaP8wHcBGCVdxwOAO4F0C9jLLl6
\n
XrIZSy6el54AniXZDqlvsplm9grJBwEUm9lcpL5ZnydZgdQLiOMCHkOLxGVux2heA/GZ23GZ10DI
\n
c1sfPyAi4qA4H5YREZFW0uIuIuIgLe4iIg7S4i4i4iAt7iIiDtLiLiLiIC3uIiIO+n9eoExMfIE/
\n
DgAAAABJRU5ErkJggg==
\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
}
Please
register
or
login
to post a comment