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

Duplicate forbiddens in ConfigurationSpace #354

Open
aron-bram opened this issue Apr 9, 2024 · 0 comments
Open

Duplicate forbiddens in ConfigurationSpace #354

aron-bram opened this issue Apr 9, 2024 · 0 comments

Comments

@aron-bram
Copy link

I noticed it was possible to add the same forbidden clause multiple times to the same space. Not sure if this is intended or not, so I thought I would raise a quick issue for it.

Here is how to replicate it:

import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH

cs = CS.ConfigurationSpace()

lower_bound = CSH.UniformIntegerHyperparameter('lower_bound', lower=0, upper=10)
upper_bound = CSH.UniformIntegerHyperparameter('upper_bound', lower=0, upper=10)

cs.add_hyperparameter(lower_bound)
cs.add_hyperparameter(upper_bound)

# add duplicate forbiddens to the same space
fgt1 = CS.ForbiddenGreaterThanRelation(lower_bound, upper_bound)
fgt2 = CS.ForbiddenGreaterThanRelation(lower_bound, upper_bound)
fgt3 = CS.ForbiddenGreaterThanRelation(lower_bound, upper_bound)

cs.add_forbidden_clause(fgt1)
cs.add_forbidden_clause(fgt2)
cs.add_forbidden_clause(fgt2)

print(cs)

What it outputs:

Configuration space object:
  Hyperparameters:
    lower_bound, Type: UniformInteger, Range: [0, 10], Default: 5
    upper_bound, Type: UniformInteger, Range: [0, 10], Default: 5
  Forbidden Clauses:
    Forbidden: lower_bound > upper_bound
    Forbidden: lower_bound > upper_bound
    Forbidden: lower_bound > upper_bound

Notice how the same forbidden appears 3 times.

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

1 participant