From 4fa4823d07e09f5f77795aced4f4d67c77e4233f Mon Sep 17 00:00:00 2001 From: chico Date: Wed, 23 Jun 2021 22:41:36 +0200 Subject: [PATCH] Fix long regresion --- autoPyTorch/pipeline/components/training/trainer/__init__.py | 5 ++--- cicd/test_preselected_configs.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/autoPyTorch/pipeline/components/training/trainer/__init__.py b/autoPyTorch/pipeline/components/training/trainer/__init__.py index b4221605a..59d6d85d8 100755 --- a/autoPyTorch/pipeline/components/training/trainer/__init__.py +++ b/autoPyTorch/pipeline/components/training/trainer/__init__.py @@ -249,10 +249,9 @@ def _fit(self, X: Dict[str, Any], y: Any = None, **kwargs: Any) -> 'TrainerChoic ) # Support additional user metrics - additional_metrics = X['additional_metrics'] if 'additional_metrics' in X else None + additional_metrics = X['additional_metrics'] if 'additional_metrics' in X else [] if 'optimize_metric' in X: - additional_metrics = additional_metrics.append(X['optimize_metric']) if additional_metrics is not None \ - else [X['optimize_metric']] + additional_metrics.append(X['optimize_metric']) additional_losses = X['additional_losses'] if 'additional_losses' in X else None self.choice.prepare( model=X['network'], diff --git a/cicd/test_preselected_configs.py b/cicd/test_preselected_configs.py index 2aa5b0d6b..2638df69d 100644 --- a/cicd/test_preselected_configs.py +++ b/cicd/test_preselected_configs.py @@ -153,7 +153,7 @@ def test_can_properly_fit_a_config(openml_task_id, configuration, scorer, lower_ train_data, target_data = fit_dictionary['backend'].load_datamanager().train_tensors predictions = pipeline.predict(train_data[val_indices]) score = scorer(fit_dictionary['y_train'][val_indices], predictions) - assert pytest.approx(score) >= lower_bound_score + assert score >= lower_bound_score # Check that we reverted to the best score run_summary = pipeline.named_steps['trainer'].run_summary