def test_experiment(self): params = ParamGrid([('p1', [3.14, 2.71]), ('p2', ['a', 'b', 'c'])]) cmd = 'python super_rl.py' ex = Experiment('test', cmd, params.generate_params(randomize=False)) cmds = ex.generate_experiments() for command, name in cmds: self.assertTrue(command.startswith(cmd)) self.assertTrue(name.startswith('test'))
def test_descr(self): params = ParamGrid([('p1', [3.14, 2.71]), ('p2', ['a', 'b', 'c'])]) experiments = [ Experiment('test1', 'python super_rl1.py', params.generate_params(randomize=False)), Experiment('test2', 'python super_rl2.py', params.generate_params(randomize=False)), ] rd = RunDescription('test_run', experiments) cmds = rd.generate_experiments() for command, name, root_dir in cmds: self.assertIn('--experiment', command) self.assertIn('--experiments_root', command) self.assertTrue(name.startswith('test')) self.assertTrue(root_dir.startswith('test_run'))
def test_simple_cmd(self): logging.disable(logging.INFO) echo_params = ParamGrid([ ('p1', [3.14, 2.71]), ('p2', ['a', 'b', 'c']), ('p3', list(np.arange(3))), ]) experiments = [ Experiment('test_echo1', 'echo', echo_params.generate_params(randomize=True)), Experiment('test_echo2', 'echo', echo_params.generate_params(randomize=False)), ] rd = RunDescription('test_run', experiments, max_parallel=10) run_many(rd) logging.disable(logging.NOTSET)
from runner.run_descriptions.run_description import RunDescription, Experiment, ParamGrid _params = ParamGrid([ ('icm_beta', [0.2]), ]) _experiments = [ Experiment( 'doom_test_basic', 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_basic --gpu_mem_fraction=0.1 --train_for_env_steps=80000', _params.generate_params(randomize=False), ), Experiment( 'doom_test_maze', 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_maze --gpu_mem_fraction=0.1 --train_for_env_steps=80000', _params.generate_params(randomize=False), ), ] DOOM_TEST_RUN = RunDescription('doom_test', experiments=_experiments, max_parallel=3)
from runner.run_descriptions.run_description import RunDescription, Experiment, ParamGrid _params = ParamGrid([ ('prediction_bonus_coeff', [0.00, 0.05]), ]) _experiments = [ Experiment( 'doom_maze_very_sparse', 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_maze_very_sparse --gpu_mem_fraction=0.1 --train_for_env_steps=2000000000', _params.generate_params(randomize=False), ), # Experiment( # 'doom_maze_sparse', # 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_maze_sparse --gpu_mem_fraction=0.1 --train_for_env_steps=100000000', # _params.generate_params(randomize=False), # ), # Experiment( # 'doom_maze', # 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_maze --gpu_mem_fraction=0.1 --train_for_env_steps=50000000', # _params.generate_params(randomize=False), # ), # Experiment( # 'doom_basic', # 'python -m algorithms.curious_a2c.train_curious_a2c --env=doom_basic --gpu_mem_fraction=0.1 --train_for_env_steps=10000000', # _params.generate_params(randomize=False), # ), ] DOOM_CURIOUS_VS_VANILLA = RunDescription('doom_curious_vs_vanilla', experiments=_experiments,