@@ -0,0 +1,1942 @@
+# Create the model%0Ax = tf.placeholder(%22float%22, %5BNone, 784%5D, name=%22x-input%22)%0AW = tf.Variable(tf.zeros(%5B784,10%5D), name=%22weights%22)%0Ab = tf.Variable(tf.zeros(%5B10%5D, name=%22bias%22))%0A%0A# use a name scope to organize nodes in the graph visualizer%0Awith tf.name_scope(%22Wx_b%22) as scope:%0A  y = tf.nn.softmax(tf.matmul(x,W) + b)%0A%0A# Add summary ops to collect data%0Aw_hist = tf.histogram_summary(%22weights%22, W)%0Ab_hist = tf.histogram_summary(%22biases%22, b)%0Ay_hist = tf.histogram_summary(%22y%22, y)%0A%0A# Define loss and optimizer%0Ay_ = tf.placeholder(%22float%22, %5BNone,10%5D, name=%22y-input%22)%0A# More name scopes will clean up the graph representation%0Awith tf.name_scope(%22xent%22) as scope:%0A  cross_entropy = -tf.reduce_sum(y_*tf.log(y))%0A  ce_summ = tf.scalar_summary(%22cross entropy%22, cross_entropy)%0Awith tf.name_scope(%22train%22) as scope:%0A  train_step = tf.train.GradientDescentOptimizer(0.01).minimize(cross_entropy)%0A%0Awith tf.name_scope(%22test%22) as scope:%0A  correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1))%0A  accuracy = tf.reduce_mean(tf.cast(correct_prediction, %22float%22))%0A  accuracy_summary = tf.scalar_summary(%22accuracy%22, accuracy)%0A%0A# Merge all the summaries and write them out to /tmp/mnist_logs%0Amerged = tf.merge_all_summaries()%0Awriter = tf.train.SummaryWriter(%22/home/ubuntu/workspace/tmp5%22, sess.graph_def)%0Atf.initialize_all_variables().run()%0A%0A# Train the model, and feed in test data and record summaries every 10 steps%0A%0Afor i in range(1000):%0A  if i %25 10 == 0:  # Record summary data, and the accuracy%0A    feed = %7Bx: mnist.test.images, y_: mnist.test.labels%7D%0A    result = sess.run(%5Bmerged, accuracy%5D, feed_dict=feed)%0A    summary_str = result%5B0%5D%0A    acc = result%5B1%5D%0A    writer.add_summary(summary_str, i)%0A    print(%22Accuracy at step %25s: %25s%22 %25 (i, acc))%0A  else:%0A    batch_xs, batch_ys = mnist.train.next_batch(100)%0A    feed = %7Bx: batch_xs, y_: batch_ys%7D%0A    sess.run(train_step, feed_dict=feed)%0A%0Aprint(accuracy.eval(%7Bx: mnist.test.images, y_: mnist.test.labels%7D))%0A

Create tb2.py