|
|
@@ -6,27 +6,32 @@ def review(frames): |
|
|
|
rew = 0 |
|
|
|
cnt = 1 |
|
|
|
|
|
|
|
for i, frame in enumerate(frames): |
|
|
|
print (u"{}[2J{}[;H".format(chr(27), chr(27))) |
|
|
|
print(f"Session: {frame['session']}") |
|
|
|
print(frame['frame']) |
|
|
|
print(f"Timestep: {i + 1}") |
|
|
|
print(f"State: {frame['state']}") |
|
|
|
print(f"Action: {frame['action']}") |
|
|
|
print(f"Reward: {frame['reward']}") |
|
|
|
try: |
|
|
|
for i, frame in enumerate(frames): |
|
|
|
out = u"{}[2J{}[;H".format(chr(27), chr(27)) |
|
|
|
out += f"Session: {frame['session']}\n" |
|
|
|
out += frame['frame'] |
|
|
|
out += f"Timestep: {i + 1}\n" |
|
|
|
out += f"State: {frame['state']}\n" |
|
|
|
out += f"Action: {frame['action']}\n" |
|
|
|
out += f"Reward: {frame['reward']}\n" |
|
|
|
|
|
|
|
sess = frame['session'] |
|
|
|
if sess != prevSess: |
|
|
|
if rew > 0: |
|
|
|
sucs += "+" |
|
|
|
sleep(1) |
|
|
|
elif rew < 0: |
|
|
|
sucs += "-" |
|
|
|
else: |
|
|
|
sucs += "." |
|
|
|
prevSess = frame['session'] |
|
|
|
cnt += 1 |
|
|
|
rew = frame['reward'] |
|
|
|
sess = frame['session'] |
|
|
|
if sess != prevSess: |
|
|
|
if rew > 0: |
|
|
|
sucs += "+" |
|
|
|
sleep(1) |
|
|
|
elif rew < 0: |
|
|
|
sucs += "-" |
|
|
|
elif prevSess >= 0: |
|
|
|
sucs += "." |
|
|
|
prevSess = frame['session'] |
|
|
|
cnt += 1 |
|
|
|
rew = frame['reward'] |
|
|
|
|
|
|
|
print(f"\nSuccesses: [{sucs}]") |
|
|
|
sleep(.1) |
|
|
|
out += f"\nSuccesses: [{sucs}]\n" |
|
|
|
print(out) |
|
|
|
sleep(.1) |
|
|
|
|
|
|
|
except KeyboardInterrupt: |
|
|
|
return() |