<jupyter_start><jupyter_text>1 For Beginner We find the accuracy for testing data<jupyter_code>sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
correct_pred = tf.equal(tf.argmax(y,1),tf.argmax(y_pred,1))
accuracy = tf.reduce_mean(tf.cast(correct_pred,tf.float32))
for _ in range(10000):
    batch_xs, batch_ys = data.train.next_batch(100)
    training_data = {x: batch_xs, y: batch_ys}
    sess.run(train_step, feed_dict=training_data)

print('Testing Accuracy:',sess.run(accuracy,feed_dict={x:data.test.images,y:data.test.labels}))<jupyter_output>Testing Accuracy: 0.9213<jupyter_text>2 Better visualization Here we can see the improvement of accuray and cross_entropy as we train more data<jupyter_code>sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
correct_pred = tf.equal(tf.argmax(y,1),tf.argmax(y_pred,1))
accuracy = tf.reduce_mean(tf.cast(correct_pred,tf.float32))

# train data
training_acc = []
training_ce = []
test_acc = []
test_ce = []
for _ in range(10000):
    batch_xs, batch_ys = data.train.next_batch(100)
  
    training_data = {x: batch_xs, y: batch_ys}
    _,acc,ce = sess.run([train_step,accuracy,cross_entropy], feed_dict=training_data)
    training_acc.append(acc)
    training_ce.append(ce)
    
    test_data = {x:data.test.images,y:data.test.labels}
    acc2,ce2 = sess.run([accuracy,cross_entropy],feed_dict=test_data)
    test_acc.append(acc2)
    test_ce.append(ce2)
test_data = {x:data.test.images,y:data.test.labels}
test_accuracy,test_crossentropy = sess.run([accuracy,cross_entropy],feed_dict=test_data)
print('Testing Accuracy:\t',test_accuracy)
print('Testing Cross Entropy:\t',test_crossentropy)
import matplotlib.pyplot as plt
plt.plot(training_acc)
plt.plot(test_acc)
plt.xlabel('Training Examples')
plt.ylabel('Accuray')
plt.show()

plt.plot(training_ce)
plt.plot(test_ce)
plt.xlabel('Training Examples')
plt.ylabel('Cross-Entropy')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13687436159346272, 'fraction_numerical': 0.01787538304392237, 'mean_word_length': 6.773809523809524, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '306324', 'license': 'MIT', 'n_tokens_mistral': 770, 'n_tokens_neox': 734, 'n_words': 109, 'path': 'Solve for MNIST/MNISTCode-1-SingleNeuron-Acc-92.ipynb', 'repo_name': 'SaminYeasar/Deep-Learning-Algos', 'size': '1958'}