-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_minigrid_mp.py
57 lines (51 loc) · 1.63 KB
/
run_minigrid_mp.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
import torch.multiprocessing as multiprocessing
from utils import *
from runtime import generate_exptag, get_set_seed, get_new_env, config_parser
import utils_mp
if __name__ == "__main__":
parser = config_parser(mp=True)
args = parser.parse_args()
config_train = {
"size": args.size_world,
"gamma": args.gamma,
"lava_density_range": [0.4, 0.4],
"uniform_init": bool(args.uniform_init),
"stochasticity": args.stochasticity,
}
configs_eval = [
{
"size": args.size_world,
"gamma": args.gamma,
"lava_density_range": [0.2, 0.3],
"uniform_init": False,
"stochasticity": args.stochasticity,
},
{
"size": args.size_world,
"gamma": args.gamma,
"lava_density_range": [0.3, 0.4],
"uniform_init": False,
"stochasticity": args.stochasticity,
},
{
"size": args.size_world,
"gamma": args.gamma,
"lava_density_range": [0.4, 0.5],
"uniform_init": False,
"stochasticity": args.stochasticity,
},
{
"size": args.size_world,
"gamma": args.gamma,
"lava_density_range": [0.5, 0.6],
"uniform_init": False,
"stochasticity": args.stochasticity,
},
]
env = get_new_env(args, **config_train)
args = generate_exptag(args, additional="")
args.seed = get_set_seed(args.seed, env)
print(args)
# MAIN
multiprocessing.set_start_method("spawn")
utils_mp.run_multiprocess(args, config_train, configs_eval)