-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotter.py
43 lines (39 loc) · 1.6 KB
/
plotter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import json
import numpy as np
from matplotlib import pyplot as plt
data = json.load(open('saved_reports/hand-balance-continuous-rewards-2022-03-14 18:14:20.048706.txt', 'r'))
data1 = json.load(open('saved_reports/hand-balance-continuous-rewards-2022-03-14 18:19:12.551098.txt', 'r'))
data = np.array(data)
data1 = np.array(data1)
plt.plot(data.mean(axis=1))
plt.plot(data1.mean(axis=1))
plt.title(
f'Training episode vs rewards (convergence)\n{data1.shape[1]} steps/episode, Max reward=1/step')
plt.xlabel('Episode')
plt.ylabel('Episode rewards')
plt.legend(['Policy LR=0.0003, Value LR=0.001', 'Policy LR=0.0003, Value LR=0.01'])
plt.grid()
plt.show()
data = json.load(open('saved_reports/hand-balance-continuous-rewards-2022-03-14 14:37:01.655896.txt', 'r'))
data1 = json.load(open('saved_reports/hand-balance-continuous-rewards-2022-03-14 16:06:08.373991.txt', 'r'))
data = np.array(data)
data1 = np.array(data1)
plt.plot(data.mean(axis=1))
plt.plot(data1.mean(axis=1))
plt.title(
f'Training episode vs rewards (convergence)\n{data1.shape[1]} steps/episode, Max reward=1/step')
plt.xlabel('Episode')
plt.ylabel('Episode rewards')
plt.legend(['Policy LR=0.03, Value LR=0.001', 'Policy LR=0.003, Value LR=0.01'])
plt.grid()
plt.show()
data = json.load(open('saved_reports/hand-balance-continuous-rewards-2022-03-12 17:55:41.714827.txt', 'r'))
data = np.array(data)
plt.plot(data.mean(axis=1))
plt.title(
f'Training episode vs rewards (convergence)\n{data1.shape[1]} steps/episode, Max reward=1/step')
plt.xlabel('Episode')
plt.ylabel('Episode rewards')
plt.legend(['Policy LR=0.0003, Value LR=0.001'])
plt.grid()
plt.show()