Skip to content

Instantly share code, notes, and snippets.

Last active Jan 13, 2018
What would you like to do?
with tf.Session(graph=graph) as session:
num_steps = 1000
batch_size = 100
for step in range(num_steps):
offset = (step * batch_size) % (train_labels.shape[0] - batch_size)
batch_images = train_images[offset:(offset + batch_size), :]
batch_labels = train_labels[offset:(offset + batch_size), :]
feed_dict = {input: batch_images, labels: batch_labels}
o, c, =[optimizer, cost], feed_dict=feed_dict)
print("Cost: ", c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment