-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·38 lines (29 loc) · 1.25 KB
/
test
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
#!/usr/bin/env python
import argparse
from agents.DDPG.model import DDPG
from agents.SAC.model import SAC
from agents.TD3.model import TD3
from commons.run_expe import test
parser = argparse.ArgumentParser(description='Test an agent in a gym environment')
parser.add_argument('agent', nargs='?', default='DDPG',
help="Choose the agent to train (one of {DDPG, TD3, SAC}).")
parser.add_argument('--no_render', action='store_false', dest="render",
help='Display the tests')
parser.add_argument('-n', '--nb_tests', default=1, type=int, dest="nb_tests",
help="Number of evaluation to perform.")
parser.add_argument('--gif', action='store_true', dest="gif",
help='Save a gif of a test')
parser.add_argument('-f', '--folder', default=None, type=str, dest="folder",
help="Folder where the models are saved")
parser.add_argument('--appli', dest='appli', type=str,
help="Choose the CFD environment (one of {flatplate, starccm, starccm_diamant}).")
args = parser.parse_args()
if args.agent == 'DDPG':
agent = DDPG
elif args.agent == 'TD3':
agent = TD3
elif args.agent == 'SAC':
agent = SAC
else:
raise Exception("Agent invalid")
test(agent, args)