Skip to content
Open
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
18 changes: 9 additions & 9 deletions ax/api/utils/instantiation/from_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ def parameter_from_config(
"The range of the parameter must be evenly divisible by the "
"step size."
)

return ChoiceParameter(
return RangeParameter(
name=config.name,
parameter_type=_parameter_type_converter(config.parameter_type),
values=[*np.arange(lower, upper + step_size, step_size)],
is_ordered=True,
lower=lower,
upper=upper,
log_scale=config.scaling == "log",
)

return RangeParameter(
return ChoiceParameter(
name=config.name,
parameter_type=_parameter_type_converter(config.parameter_type),
lower=lower,
upper=upper,
log_scale=config.scaling == "log",
values=[*np.arange(lower, upper + step_size, step_size)],
is_ordered=True,
)
Comment on lines +53 to 65
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the return values in & out of the if statement changed places here. This doesn't seem like the correct behavior here.



elif isinstance(config, DerivedParameterConfig):
return DerivedParameter(
name=config.name,
Expand Down