PLEASE EXPLAIN HOW THESE TWO ARE DEFINED IN THE BELOW CODE, I COULD’nt FIND THEIR EXPLANATION ANYWHERE OR HOW THEY ARE INITIAILIZED.
mnist.train.num_examples
mnist.train.next_batch
with tf.Session() as sess:
init.run()
for epoch in range(n_epochs):
for iteration in range(mnist.train.num_examples // batch_size):
X_batch, y_batch = mnist.train.next_batch(batch_size)
sess.run(training_op, feed_dict={X: X_batch, y: y_batch})
if epoch % 5 == 0:
acc_train = accuracy.eval(feed_dict={X: X_batch, y: y_batch})
acc_test = accuracy.eval(feed_dict={X: mnist.validation.images, y: mnist.validation.labels})
print(epoch, “Batch accuracy:”, acc_train, “Validation accuracy:”, acc_test)
w = tf.get_default_graph().get_tensor_by_name(“hidden1/kernel:0”).eval()
print(w)
save_path = saver.save(sess, “model_ckps/my_model_final.ckpt”)