Skip to content

Commit

Permalink
add quantization_bins check
Browse files Browse the repository at this point in the history
  • Loading branch information
motus committed Aug 15, 2024
1 parent 2d241e7 commit 09a502a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mlos_bench/mlos_bench/optimizers/convert_configspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def _monkey_patch_quantization(hp: NumericalHyperparameter, quantization_bins: i
quantization_bins : int
Number of bins to quantize the hyperparameter into.
"""
if quantization_bins <= 1:
raise ValueError(f"{quantization_bins=} :: must be greater than 1.")

# Temporary workaround to dropped quantization support in ConfigSpace 1.0
# See Also: https://github.com/automl/ConfigSpace/issues/390
if not hasattr(hp, "sample_value_mlos_orig"):
Expand Down

0 comments on commit 09a502a

Please sign in to comment.