mACHINE lEARNING eXPERIMENTS by LP SANSHODHANA

mACHINE lEARNING eXPERIMENTS by LP SANSHODHANA

Author:LP, SANSHODHANA
Language: eng
Format: epub
Published: 2016-12-27T16:00:00+00:00


# Launch the graph

with tf.Session() as sess:

sess.run(init)

i=0

# Fit all training data

for epoch in range(training_epochs):

i=0

for (x, y) in zip(train_X, train_Y):

if i<2:

sess.run(optimizer, feed_dict={X: x, Y: y})

i=i+1

# Display logs per epoch step

if (epoch+1) % display_step == 0:

c = sess.run(cost, feed_dict={X: train_X, Y:train_Y})

print("Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(c), \

"W=", sess.run(W), "b=", sess.run(b))

print("Optimization Finished!")

training_cost = sess.run(cost, feed_dict={X: train_X, Y: train_Y})

print("Training cost=", training_cost, "W=", sess.run(W), "b=", sess.run(b), '\n')

The figure below shows the problem space and the regression line in the second scatter graph in the figure below.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.