def objective(params):
        config = {'model_name': model_name, 'num_epochs': num_epochs}

        for (key, value) in params.items():
            config[key] = value
            print("Parameter: {} | Value: {}".format(key, value))

        run = experiment.run(config_updates=config)

        return run.result
예제 #2
0
 def test_train_cartpole_td3_tdg(self):
     from main import ex
     config = dict(env_name='GYMMB_CartPole-v1',
                   agent_alg='td3',
                   tdg_error_weight=5,
                   dump_dir=None,
                   print_config=False,
                   seed=123,
                   n_total_steps=200,
                   n_warm_up_steps=50,
                   model_training_n_batches=10,
                   policy_training_n_iters=5,
                   policy_actors=32,
                   eval_freq=100,
                   n_eval_episodes_per_policy=1,
                   neptune_project=None)
     ret, abs_action = ex.run('train', config_updates=config).result
     self.assertAlmostEqual(ret, 42.)
     self.assertAlmostEqual(abs_action, 0.39846721291542053)
예제 #3
0
 def test_train_test_ddpg(self):
     from main import ex
     config = dict(env_name='GYMMB_Test-v0',
                   agent_alg='ddpg',
                   tdg_error_weight=0,
                   dump_dir=None,
                   print_config=False,
                   seed=123,
                   n_total_steps=200,
                   n_warm_up_steps=50,
                   model_training_n_batches=50,
                   policy_training_n_iters=5,
                   policy_actors=32,
                   eval_freq=100,
                   n_eval_episodes_per_policy=1,
                   neptune_project=None)
     ret, abs_action = ex.run('train', config_updates=config).result
     self.assertAlmostEqual(ret, -0.02898537367582321)
     self.assertAlmostEqual(abs_action, 0.06166519597172737)