-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
34 lines (28 loc) · 919 Bytes
/
plot.py
File metadata and controls
34 lines (28 loc) · 919 Bytes
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
import numpy as np
import matplotlib.pyplot as plt
import csv
def load_data(path):
with open(path, 'r') as f:
reader = csv.reader(f, delimiter=',')
header = next(reader)
data = np.array(list(reader)).astype(float)
return header, data
if __name__ == '__main__':
header, data = load_data('data/name-of-experiment/name-of-experiment_2021_11_19_14_23_55_0000--s-0/progress.csv')
ns = range(data.shape[0])
print(header)
print(header[10])
print(header[11])
print(header[12])
avs = data[:,11]
maxs = data[:,10]
mins = data[:,12]
# method = "mixed"
plt.fill_between(ns, mins, maxs, alpha=0.1)
plt.plot(ns, avs, '-o', markersize=1, label="Train")
plt.legend()
plt.grid(True)
plt.xlabel('Time step', fontsize = 15)
plt.ylabel('Return', fontsize = 15)
plt.title("SAC PCA", fontsize = 24)
plt.savefig("plots/SAC PCA.png")