From 57bb08325d82cf1ce67c3d26b85ed19f8a41677c Mon Sep 17 00:00:00 2001 From: demianzhang Date: Wed, 27 Mar 2019 17:36:08 +0800 Subject: [PATCH 1/2] Update naive_trial.py --- test/tuner_test/naive_trial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tuner_test/naive_trial.py b/test/tuner_test/naive_trial.py index d8cfbc2682..d776151a58 100644 --- a/test/tuner_test/naive_trial.py +++ b/test/tuner_test/naive_trial.py @@ -1,6 +1,6 @@ import nni -params = nni.get_parameters() +params = nni.get_next_parameter() print('params:', params) x = params['x'] From aec3e29d2d6f465e7daad761a3eff2e2f8dfac3b Mon Sep 17 00:00:00 2001 From: demianzhang Date: Sat, 13 Apr 2019 17:27:50 +0800 Subject: [PATCH 2/2] Fix test BatchTuner --- test/tuner_test.py | 4 ++++ test/tuner_test/batchtuner_search_space.json | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/tuner_test/batchtuner_search_space.json diff --git a/test/tuner_test.py b/test/tuner_test.py index 131fa3971f..139a3f4844 100644 --- a/test/tuner_test.py +++ b/test/tuner_test.py @@ -49,6 +49,10 @@ def switch(dispatch_type, dispatch_name): 'optimize_mode': 'maximize' } } + if dispatch_name == 'BatchTuner': + experiment_config['searchSpacePath'] = 'batchtuner_search_space.json' + else: + experiment_config['searchSpacePath'] = 'search_space.json' dump_yml_content(config_path, experiment_config) def test_builtin_dispatcher(dispatch_type, dispatch_name): diff --git a/test/tuner_test/batchtuner_search_space.json b/test/tuner_test/batchtuner_search_space.json new file mode 100644 index 0000000000..5d3beeee85 --- /dev/null +++ b/test/tuner_test/batchtuner_search_space.json @@ -0,0 +1,8 @@ +{ + "combine_params": + { + "_type" : "choice", + "_value" : [{"x": 1}, + {"x": 100}] + } +}