Keep dimensions stored in hyperopt class

There is no point in regenerating them and it will cause some
overhead as all space classes will be recreated for every epoch.
This commit is contained in:
Matthias
2021-05-02 09:35:10 +02:00
parent ced5cc7ce2
commit 46f0f66039
2 changed files with 33 additions and 33 deletions

View File

@@ -695,7 +695,8 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None:
hyperopt = Hyperopt(hyperopt_conf)
hyperopt.min_date = Arrow(2017, 12, 10)
hyperopt.max_date = Arrow(2017, 12, 13)
hyperopt.dimensions = hyperopt.hyperopt_space()
hyperopt.init_spaces()
hyperopt.dimensions = hyperopt.dimensions
generate_optimizer_value = hyperopt.generate_optimizer(list(optimizer_param.values()))
assert generate_optimizer_value == response_expected