Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure minimize is passed to make_experiment #2251

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ax/service/managed_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
get_best_parameters_from_model_predictions,
get_best_raw_objective_point,
)
from ax.service.utils.instantiation import InstantiationBase, TParameterRepresentation
from ax.service.utils.instantiation import (
DEFAULT_OBJECTIVE_NAME,
InstantiationBase,
TParameterRepresentation,
)
from ax.utils.common.executils import retry_on_exception
from ax.utils.common.logger import get_logger
from ax.utils.common.typeutils import not_none
Expand Down Expand Up @@ -99,14 +103,12 @@ def with_evaluation_function(
) -> "OptimizationLoop":
"""Constructs a synchronous `OptimizationLoop` using an evaluation
function."""
if objective_name is None:
objective_name = DEFAULT_OBJECTIVE_NAME
experiment = InstantiationBase.make_experiment(
name=experiment_name,
parameters=parameters,
objectives=(
{objective_name: "minimize" if minimize else "maximize"}
if objective_name
else None
),
objectives={objective_name: "minimize" if minimize else "maximize"},
parameter_constraints=parameter_constraints,
outcome_constraints=outcome_constraints,
)
Expand Down
Loading