|
| 1 | +_atari7 = ['BeamRider', 'Breakout', 'Enduro', 'Pong', 'Qbert', 'Seaquest', 'SpaceInvaders'] |
| 2 | +_atariexpl7 = ['Freeway', 'Gravitar', 'MontezumaRevenge', 'Pitfall', 'PrivateEye', 'Solaris', 'Venture'] |
| 3 | + |
| 4 | +_BENCHMARKS = [] |
| 5 | + |
| 6 | +def register_benchmark(benchmark): |
| 7 | + for b in _BENCHMARKS: |
| 8 | + if b['name'] == benchmark['name']: |
| 9 | + raise ValueError('Benchmark with name %s already registered!'%b['name']) |
| 10 | + _BENCHMARKS.append(benchmark) |
| 11 | + |
| 12 | +def list_benchmarks(): |
| 13 | + return [b['name'] for b in _BENCHMARKS] |
| 14 | + |
| 15 | +def get_benchmark(benchmark_name): |
| 16 | + for b in _BENCHMARKS: |
| 17 | + if b['name'] == benchmark_name: |
| 18 | + return b |
| 19 | + raise ValueError('%s not found! Known benchmarks: %s' % (benchmark_name, list_benchmarks())) |
| 20 | + |
| 21 | +def get_task(benchmark, env_id): |
| 22 | + """Get a task by env_id. Return None if the benchmark doesn't have the env""" |
| 23 | + return next(filter(lambda task: task['env_id'] == env_id, benchmark['tasks']), None) |
| 24 | + |
| 25 | +_ATARI_SUFFIX = 'NoFrameskip-v4' |
| 26 | + |
| 27 | +register_benchmark({ |
| 28 | + 'name' : 'Atari200M', |
| 29 | + 'description' :'7 Atari games from Mnih et al. (2013), with pixel observations, 200M frames', |
| 30 | + 'tasks' : [{'env_id' : _game + _ATARI_SUFFIX, 'trials' : 2, 'num_timesteps' : int(200e6)} for _game in _atari7] |
| 31 | +}) |
| 32 | + |
| 33 | +register_benchmark({ |
| 34 | + 'name' : 'Atari40M', |
| 35 | + 'description' :'7 Atari games from Mnih et al. (2013), with pixel observations, 40M frames', |
| 36 | + 'tasks' : [{'env_id' : _game + _ATARI_SUFFIX, 'trials' : 2, 'num_timesteps' : int(40e6)} for _game in _atari7] |
| 37 | +}) |
| 38 | + |
| 39 | +register_benchmark({ |
| 40 | + 'name' : 'Atari1Hr', |
| 41 | + 'description' :'7 Atari games from Mnih et al. (2013), with pixel observations, 1 hour of walltime', |
| 42 | + 'tasks' : [{'env_id' : _game + _ATARI_SUFFIX, 'trials' : 2, 'num_seconds' : 60*60} for _game in _atari7] |
| 43 | +}) |
| 44 | + |
| 45 | +register_benchmark({ |
| 46 | + 'name' : 'AtariExploration40M', |
| 47 | + 'description' :'7 Atari games emphasizing exploration, with pixel observations, 40M frames', |
| 48 | + 'tasks' : [{'env_id' : _game + _ATARI_SUFFIX, 'trials' : 2, 'num_timesteps' : int(40e6)} for _game in _atariexpl7] |
| 49 | +}) |
| 50 | + |
| 51 | + |
| 52 | +_mujocosmall = [ |
| 53 | + 'InvertedDoublePendulum-v1', 'InvertedPendulum-v1', |
| 54 | + 'HalfCheetah-v1', 'Hopper-v1', 'Walker2d-v1', |
| 55 | + 'Reacher-v1', 'Swimmer-v1'] |
| 56 | + |
| 57 | +register_benchmark({ |
| 58 | + 'name' : 'Mujoco1M', |
| 59 | + 'description' : 'Some small 2D MuJoCo tasks, run for 1M timesteps', |
| 60 | + 'tasks' : [{'env_id' : _envid, 'trials' : 3, 'num_timesteps' : int(1e6)} for _envid in _mujocosmall] |
| 61 | +}) |
| 62 | + |
| 63 | +_roboschool_mujoco = [ |
| 64 | + 'RoboschoolInvertedDoublePendulum-v0', 'RoboschoolInvertedPendulum-v0', # cartpole |
| 65 | + 'RoboschoolHalfCheetah-v0', 'RoboschoolHopper-v0', 'RoboschoolWalker2d-v0', # forward walkers |
| 66 | + 'RoboschoolReacher-v0' |
| 67 | + ] |
| 68 | + |
| 69 | +register_benchmark({ |
| 70 | + 'name' : 'RoboschoolMujoco2M', |
| 71 | + 'description' : 'Same small 2D tasks, still improving up to 2M', |
| 72 | + 'tasks' : [{'env_id' : _envid, 'trials' : 3, 'num_timesteps' : int(2e6)} for _envid in _roboschool_mujoco] |
| 73 | +}) |
| 74 | + |
| 75 | + |
| 76 | +_atari50 = [ # actually 49 |
| 77 | + 'Alien', 'Amidar', 'Assault', 'Asterix', 'Asteroids', |
| 78 | + 'Atlantis', 'BankHeist', 'BattleZone', 'BeamRider', 'Bowling', |
| 79 | + 'Boxing', 'Breakout', 'Centipede', 'ChopperCommand', 'CrazyClimber', |
| 80 | + 'DemonAttack', 'DoubleDunk', 'Enduro', 'FishingDerby', 'Freeway', |
| 81 | + 'Frostbite', 'Gopher', 'Gravitar', 'IceHockey', 'Jamesbond', |
| 82 | + 'Kangaroo', 'Krull', 'KungFuMaster', 'MontezumaRevenge', 'MsPacman', |
| 83 | + 'NameThisGame', 'Pitfall', 'Pong', 'PrivateEye', 'Qbert', |
| 84 | + 'Riverraid', 'RoadRunner', 'Robotank', 'Seaquest', 'SpaceInvaders', |
| 85 | + 'StarGunner', 'Tennis', 'TimePilot', 'Tutankham', 'UpNDown', |
| 86 | + 'Venture', 'VideoPinball', 'WizardOfWor', 'Zaxxon', |
| 87 | +] |
| 88 | + |
| 89 | +register_benchmark({ |
| 90 | + 'name' : 'Atari50_40M', |
| 91 | + 'description' :'7 Atari games from Mnih et al. (2013), with pixel observations, 40M frames', |
| 92 | + 'tasks' : [{'env_id' : _game + _ATARI_SUFFIX, 'trials' : 3, 'num_timesteps' : int(40e6)} for _game in _atari50] |
| 93 | +}) |
0 commit comments