Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Tathagatd96/e1c533c741931feeb82a2aaf92f3290d to your computer and use it in GitHub Desktop.
Save Tathagatd96/e1c533c741931feeb82a2aaf92f3290d to your computer and use it in GitHub Desktop.
num_epoch=5
batch_size=150
num_test_images=10
with tf.Session() as sess:
sess.run(init)
for epoch in range(num_epoch):
num_batches=mnist.train.num_examples//batch_size
for iteration in range(num_batches):
X_batch,y_batch=mnist.train.next_batch(batch_size)
sess.run(train,feed_dict={X:X_batch})
train_loss=loss.eval(feed_dict={X:X_batch})
print("epoch {} loss {}".format(epoch,train_loss))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment