Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for step in range(model.input.epoch_size):
- feed_dict = {}
- for i, (c, h) in enumerate(model.initial_state):
- feed_dict[c] = state[i].c
- feed_dict[h] = state[i].h
- vals = session.run(fetches, feed_dict)
- cost = vals["cost"]
- state = vals["final_state"]
- costs += cost
- iters += model.input.num_steps
- if verbose and step % (model.input.epoch_size // 10) == 10:
- print("%.3f perplexity: %.3f speed: %.0f wps" %
- (step * 1.0 / model.input.epoch_size, np.exp(costs / iters),
- iters * model.input.batch_size / (time.time() - start_time)))
Add Comment
Please, Sign In to add comment