ConfigSpace icon indicating copy to clipboard operation
ConfigSpace copied to clipboard

`get_neighbours` of log transformed `UniformIntegerHyperparameter` can hang

Open eddiebergman opened this issue 3 years ago • 1 comments

from ConfigSpace import UniformIntegerHyperparameter

u = UniformIntegerHyperparameter("u", 1, 10, log=True)

rs = np.random.RandomState(3)
u.get_neighbors(3, rs)
# Hangs....

eddiebergman avatar Jun 28 '22 11:06 eddiebergman

This is possibly related to #187.

mfeurer avatar Jun 30 '22 07:06 mfeurer

The refactor for #187 added a check which makes the given input invalid and the output is now

Traceback (most recent call last):
  File "/home/feurerm/sync_dir/projects/ConfigSpace/bug263.py", line 7, in <module>
    u.get_neighbors(3, rs)
  File "ConfigSpace/hyperparameters.pyx", line 1604, in ConfigSpace.hyperparameters.UniformIntegerHyperparameter.get_neighbors
    assert 0 <= value <= 1, (
AssertionError: For get neighbors of UniformIntegerHyperparameter, the value if assumed to be in the unit-hypercube [0, 1]. If this was not the behaviour assumed, please raise a ticket on github.

mfeurer avatar Jan 13 '23 07:01 mfeurer