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

Uniform real dimension interval does not align with input #1018

Closed
donglinjy opened this issue Nov 2, 2022 · 1 comment
Closed

Uniform real dimension interval does not align with input #1018

donglinjy opened this issue Nov 2, 2022 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@donglinjy
Copy link
Collaborator

Try different inputs as below. The first one is how we map Configspace UniformFloatHyperparameter into orion Real dimension.

>>> from orion.algo.space import Real,Dimension
>>> 
>>> Real("final_lr_fraction_log2", "uniform", -4.0, 0.0, default_value=-0.2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 462, in __init__
    super().__init__(name, prior, *args, **kwargs)
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 185, in __init__
    self.validate()
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 206, in validate
    raise ValueError(
ValueError: -0.2 is not a valid value for this Dimension. Can't set default value.
>>> 
>>> Real("final_lr_fraction_log2", "uniform", -4.0, 0.0, low=-4.0, high=0.0, default_value=-0.2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 462, in __init__
    super().__init__(name, prior, *args, **kwargs)
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 185, in __init__
    self.validate()
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 206, in validate
    raise ValueError(
ValueError: -0.2 is not a valid value for this Dimension. Can't set default value.
>>> 
>>> Real("final_lr_fraction_log2", "uniform", low=-4.0, high=0.0, default_value=-0.2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 462, in __init__
    super().__init__(name, prior, *args, **kwargs)
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 185, in __init__
    self.validate()
  File "/root/donglbj/hpobench/orion/src/orion/algo/space/__init__.py", line 206, in validate
    raise ValueError(
ValueError: -0.2 is not a valid value for this Dimension. Can't set default value.

@bouthilx

@donglinjy donglinjy added the bug Indicates an unexpected problem or unintended behavior label Nov 2, 2022
Delaunay pushed a commit to Delaunay/orion that referenced this issue Nov 28, 2022
@Delaunay
Copy link
Collaborator

So the behavior with Real is expected this is because the uniform dimension does not take
min, max as parameters but min, scale with scale = max - min.

The conversion is done inside by the dimension builder which is generally used to create the Orion Space.
There is a bug in the Orion space => Config Space function which was not making the right conversion.
PR#1034 should fix this

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants