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

Possible bug in ForbiddenEqualsRelation? #389

Open
mdorier opened this issue Aug 2, 2024 · 3 comments
Open

Possible bug in ForbiddenEqualsRelation? #389

mdorier opened this issue Aug 2, 2024 · 3 comments

Comments

@mdorier
Copy link
Contributor

mdorier commented Aug 2, 2024

I have this sample code:

from ConfigSpace import ConfigurationSpace, ForbiddenEqualsRelation, Integer

cs = ConfigurationSpace()
x =  Integer('x', (0,3))
y =  Integer('y', (0,3))
cs.add(x)
cs.add(y)
cs.add(ForbiddenEqualsRelation(x, y))

which gives me an exception:

ConfigSpace.exceptions.ForbiddenValueError: Given vector violates forbidden clause: Forbidden: x == y

If I'm changing ForbiddenEqualsRelation to ForbiddenGreaterThanRelation the code works fine, generating configurations such that x is always less than or equal to y. I would expect ForbiddenEqualsRelation to allow me to generate configurations such that x is always different from y. Am I misunderstanding the use of ForbiddenEqualsRelation or is there a bug?

@eddiebergman
Copy link
Contributor

Ahh, the issue is actually just a bad error message. The issue you are seeing derives from the fact that the default configuration is forbidden, and ConfigSpace requires the default configuration to be valid.

You can get around this fact by setting a default on one of them not be round((3 - 0)/ 2) == 2

@mdorier
Copy link
Contributor Author

mdorier commented Aug 2, 2024

Thanks, it makes sense, at least it forces the user to provide a valid default configuration, proving that such a configuration exists (otherwise it's a SAT problem).

@eddiebergman
Copy link
Contributor

Good point, from a more practical standpoint, the default is also used internally in configuration neighborhood search, for example, it answers the question that if a conditional was activated that suddenly activated a bunch of new parameters, what should they be set to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants