MCPcopy Create free account
hub / github.com/MorvanZhou/Tensorflow-Tutorial / eval

Function eval

tutorial-contents/504_distributed_training.py:82–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81
82def eval():
83 tf_x = tf.placeholder(tf.float32, [None, 1])
84 l1 = tf.layers.dense(tf_x, 10, tf.nn.relu)
85 output = tf.layers.dense(l1, 1)
86 saver = tf.train.Saver()
87 sess = tf.Session()
88 saver.restore(sess, tf.train.latest_checkpoint('./tmp'))
89 result = sess.run(output, {tf_x: x})
90 # plot
91 import matplotlib.pyplot as plt
92 plt.scatter(x.ravel(), y, c='b')
93 plt.plot(x.ravel(), result.ravel(), c='r')
94 plt.show()
95
96
97if __name__ == "__main__":

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected