My OpenAI playground
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

review.py 819B

5 jaren geleden
1234567891011121314151617181920212223242526272829303132
  1. from . import *
  2. def review(frames):
  3. sucs = ""
  4. prevSess = -1
  5. rew = 0
  6. cnt = 1
  7. for i, frame in enumerate(frames):
  8. print (u"{}[2J{}[;H".format(chr(27), chr(27)))
  9. print(f"Session: {frame['session']}")
  10. print(frame['frame'])
  11. print(f"Timestep: {i + 1}")
  12. print(f"State: {frame['state']}")
  13. print(f"Action: {frame['action']}")
  14. print(f"Reward: {frame['reward']}")
  15. sess = frame['session']
  16. if sess != prevSess:
  17. if rew > 0:
  18. sucs += "+"
  19. sleep(1)
  20. elif rew < 0:
  21. sucs += "-"
  22. else:
  23. sucs += "."
  24. prevSess = frame['session']
  25. cnt += 1
  26. rew = frame['reward']
  27. print(f"\nSuccesses: [{sucs}]")
  28. sleep(.1)