Guest User

Untitled

a guest
Dec 6th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. for step in range(model.input.epoch_size):
  2. feed_dict = {}
  3. for i, (c, h) in enumerate(model.initial_state):
  4. feed_dict[c] = state[i].c
  5. feed_dict[h] = state[i].h
  6.  
  7. vals = session.run(fetches, feed_dict)
  8. cost = vals["cost"]
  9. state = vals["final_state"]
  10.  
  11. costs += cost
  12. iters += model.input.num_steps
  13.  
  14. if verbose and step % (model.input.epoch_size // 10) == 10:
  15. print("%.3f perplexity: %.3f speed: %.0f wps" %
  16. (step * 1.0 / model.input.epoch_size, np.exp(costs / iters),
  17. iters * model.input.batch_size / (time.time() - start_time)))
Add Comment
Please, Sign In to add comment