char-rnn-tensorflow icon indicating copy to clipboard operation
char-rnn-tensorflow copied to clipboard

2 train steps for a single batch?

Open larin92 opened this issue 7 years ago • 3 comments

Hi,

There are such lines of code at train.py file: train_loss, state, _ = sess.run([model.cost, model.final_state, model.train_op], feed) summ, train_loss, state, _ = sess.run([summaries, model.cost, model.final_state, model.train_op], feed)

Means, we run 2 train steps on a single batch. Why?

larin92 avatar May 29 '17 09:05 larin92

directly above the 2nd line you quoted beginning with "summ, train_loss...," is the comment:

# instrument for tensorboard

anytime you see tensorFlow code referring to a summary or summaries, it likely there to facilitate tensorBoard visualization

shy1 avatar Jun 23 '17 12:06 shy1

Yes, but this can be accomplished in one execution of session.run. It looks like one of those lines should be commented out at a time

larin92 avatar Jun 23 '17 12:06 larin92

@larin92 Yeah I notice the same problem, I saw someone made a pull request and delete one line. But the pull request is not accepted by the auto code check.

GaoleMeng avatar Jul 27 '17 09:07 GaoleMeng