Last active
December 9, 2017 17:36
-
-
Save Ruhshan/0a8f61129cc4d577e1fe8e07b3d8b65b 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): | |
epoch_loss = 0 | |
i=0 | |
while i < len(train_x): | |
start = i | |
end = i+batch_size | |
batch_x = np.array(train_x[start:end]) | |
batch_y = np.array(train_y[start:end]) | |
_, 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