I'm trying to modify Tensorflow's RNN sample here.
https://www.tensorflow.org/versions/r0.8/tutorials/recurrent/index.html
At ptb_word_lm.py I guess they are inputting int array of word index (m.input_data:x).
def run_epoch(session, m, data, eval_op, verbose=False):
"""Runs the model on the given data."""
epoch_size = ((len(data) // m.batch_size) - 1) // m.num_steps
start_time = time.time()
costs = 0.0
iters = 0
state = m.initial_state.eval()
for step, (x, y) in enumerate(reader.ptb_iterator(data, m.batch_size,
m.num_steps)):
cost, state, _ = session.run([m.cost, m.final_state, eval_op],
{m.input_data: x,
m.targets: y,
m.initial_state: state})
I'd like to see actual words instead of ids, how can I see them?