-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcurrent_session.py
61 lines (49 loc) · 1.61 KB
/
current_session.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# coding: utf-8
import json
filename = "./runs-data-famo.json"
with open(filename) as f:
data = json.load(f)
data
uniformity = [d["uniformity"] for d in data]
diversity = [d["diversity"] for d in data]
novelty = [d["novelty"] for d in data]
data
data[0
]
data[0]
data.keys()
data['Scattered-best_reward']
data['Scattered-best_reward'][0]
data['Scattered-best_reward'][0][0]
for run in data['Scattered-best_reward']:
r
unique_data = []
unique_data = {}
for run in data['Scattered-best_reward']:
r
for run in data['Scattered-best_reward']:
for step in run:
if not f"{step['input_set_id']}-{step['operator']}-{step['parameter']}" in unique_data:
unique_data[f"{step['input_set_id']}-{step['operator']}-{step['parameter']}"] = step
unique_data
len(unique_data
)
len(data['Scattered-best_reward'][0])
filename = "./runs-data.json"
with open(filename) as f:
data = json.load(f)
for run in data['Scattered-best_reward']:
for step in run:
if not f"{step['input_set_id']}-{step['operator']}-{step['parameter']}" in unique_data:
unique_data[f"{step['input_set_id']}-{step['operator']}-{step['parameter']}"] = step
len(unique_data
)
with open(filename) as f:
data = json.load(f)
for run in data['Scattered-best_reward']:
for step in run:
if not f"{step['input_set_id']}-{step['operator']}-{step['parameter']}" in unique_data:
unique_data[f"{step['input_set_id']}-{step['operator']}-{step['parameter']}"] = step
len(unique_data
)
get_ipython().run_line_magic('save', 'current_session ~0/')