Last active
December 9, 2017 17:26
-
-
Save Ruhshan/f5f5c7496d00b200645e3c0b88b77176 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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