-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·54 lines (40 loc) · 1.22 KB
/
Copy pathplot.py
File metadata and controls
executable file
·54 lines (40 loc) · 1.22 KB
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
44
45
46
47
48
49
50
51
52
53
54
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
legends = ['Non-Equivariant', 'Equivariant', '', '', '']
# add any folder directories here!
log_list = [
pd.read_csv("trained_models/no_equi_no_pred_5_orca/progress.csv"),
pd.read_csv("trained_models/equi_orca_5_no_history/progress.csv"),
]
logDicts = {}
for i in range(len(log_list)):
logDicts[i] = log_list[i]
graphDicts={0:'eprewmean', 1:'loss/value_loss'}
legendList=[]
# summarize history for accuracy
steps = 400
# for each metric
for i in range(len(graphDicts)):
plt.figure(i)
plt.title(graphDicts[i])
j = 0
timesteps = []
values = []
for key in logDicts:
if graphDicts[i] not in logDicts[key]:
continue
else:
plt.ticklabel_format(axis='x', style='sci', scilimits=(0,0))
ts = logDicts[key]['misc/total_timesteps'].values
vs = logDicts[key][graphDicts[i]].values
print(ts.shape[0])
plt.plot(ts[:steps],vs[:steps])
legendList.append(legends[j])
print('avg', str(key), graphDicts[i], np.average(logDicts[key][graphDicts[i]]))
j = j + 1
print('------------------------')
plt.xlabel('total_timesteps')
plt.legend(legendList, loc='lower right')
legendList=[]
plt.show()