Skip to content

Commit

Permalink
Fix long regresion
Browse files Browse the repository at this point in the history
  • Loading branch information
franchuterivera committed Jun 23, 2021
1 parent 76bdde7 commit 4fa4823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions autoPyTorch/pipeline/components/training/trainer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion cicd/test_preselected_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4fa4823

Please sign in to comment.