Skip to content

Instantly share code, notes, and snippets.

@Ruhshan
Last active December 9, 2017 17:26
Show Gist options
  • Save Ruhshan/f5f5c7496d00b200645e3c0b88b77176 to your computer and use it in GitHub Desktop.
Save Ruhshan/f5f5c7496d00b200645e3c0b88b77176 to your computer and use it in GitHub Desktop.
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch in range(n_epochs):
train_data_batch_gen = get_train_data_batch(batch_size)
epoch_loss = 0
i=0
while i < total_lines:
train_x, train_y = next(train_data_batch_gen)
batch_x = np.array(train_x)
batch_y = np.array(train_y)
_, c = sess.run([optimizer, cost], feed_dict={x: batch_x,y: batch_y})
epoch_loss += c
i+=batch_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment