()
| 80 | |
| 81 | |
| 82 | def 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 | |
| 97 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected