-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
30 lines (25 loc) · 863 Bytes
/
test.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
from main import main
import logging
from tqdm import tqdm
import pickle
logging.basicConfig(level=logging.WARNING, format="%(message)s")
results = dict()
for fname, ini in [
("data.assignment.big.pickle", "assignment"),
("data.big.pickle", "empty"),
]:
for i in tqdm(range(100), desc="Experiments"):
for rollouts in tqdm(
[5, 10, 20, 50, 100, 200, 300, 500, 1000, 2000, 5000, 10000],
desc="Rollouts",
):
win, win_probs, q_values = main(n_rollouts=rollouts, ini_game=ini)
logging.info(f"{rollouts}, {i}, {win}")
results[(rollouts, i)] = {
"win": win,
"probs": win_probs,
"q_vals": q_values,
}
with open(fname, "wb") as fp:
pickle.dump(results, fp)
logging.info("Saved")