ledmands commited on
Commit
e64054f
1 Parent(s): a2ff203

Modified plot_evaluations.py with experimental labels and scaling. Still needs more tuning.

Browse files
Files changed (1) hide show
  1. agents/plot_evaluations.py +11 -5
agents/plot_evaluations.py CHANGED
@@ -2,7 +2,9 @@ from numpy import load
2
  import matplotlib.pyplot as plt
3
  # import matplotlib.axes
4
 
5
- data = load("evaluations.npz")
 
 
6
  lst = data.files # data.files lists the keys that are available for data
7
 
8
  # print('ep_lengths: \n', data['ep_lengths'])
@@ -36,11 +38,15 @@ for eval in data['ep_lengths']:
36
 
37
  avg_ep_len = ep_len_sum / len(eval)
38
  avg_ep_len_arr.append(avg_ep_len)
39
- y_limit = y_limit * 1.01
40
 
41
 
42
- plt.plot(data['timesteps'], avg_ep_result_arr)
43
- plt.bar(data['timesteps'], avg_ep_len_arr, width=10000)
 
44
  plt.ylim(top=y_limit)
45
-
 
 
 
46
  plt.show()
 
2
  import matplotlib.pyplot as plt
3
  # import matplotlib.axes
4
 
5
+ filepath = "dqn_v2-5/evaluations.npz"
6
+
7
+ data = load(filepath)
8
  lst = data.files # data.files lists the keys that are available for data
9
 
10
  # print('ep_lengths: \n', data['ep_lengths'])
 
38
 
39
  avg_ep_len = ep_len_sum / len(eval)
40
  avg_ep_len_arr.append(avg_ep_len)
41
+ y_limit = y_limit * 1.9
42
 
43
 
44
+ x = plt.plot(data['timesteps'], avg_ep_result_arr)
45
+ # plt.bar(data['timesteps'], avg_ep_len_arr, width=10000)
46
+ y = plt.plot(data['timesteps'], avg_ep_len_arr)
47
  plt.ylim(top=y_limit)
48
+ # plt.ylabel("Avg ep score")
49
+ # lineObjects = plt.plot(x, y)
50
+ plt.legend(["avg ep result", "avg ep length"])
51
+ plt.title("result and length over steps\nfilepath: " + filepath)
52
  plt.show()