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

Refactor random strategy #347

Merged
merged 4 commits into from
Jan 31, 2024
Merged

Refactor random strategy #347

merged 4 commits into from
Jan 31, 2024

Conversation

jduerholt
Copy link
Contributor

This PR refactors the random strategy: instead of using either polytope sampling or rejection sampling, it uses now a combination of both which allows for the handling of more constraint types by the random strategy.

Docstrings will be also updated.

@jduerholt jduerholt requested a review from bertiqwerty January 30, 2024 18:03
Copy link
Contributor

@bertiqwerty bertiqwerty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Johannes. I left 2 comments. Please have a quick look and merge as you like.

bofire/strategies/random.py Outdated Show resolved Hide resolved
@@ -2,6 +2,7 @@

from bofire.data_models.strategies.doe import DoEStrategy
from bofire.data_models.strategies.factorial import FactorialStrategy
from bofire.data_models.strategies.polytope import PolytopeSampler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are now also strategies that are called Sampler the naming becomes somewhat inconsistent, no? RandomStrategy is also just a sampling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully agree, but I do not have a proper solution, how would you do the naming?

Copy link
Contributor

@bertiqwerty bertiqwerty Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... The easiest would be that all are strategies. Which they are. With samplers we probably mean not-predictive, right? Then we would call DoE a sampler and Random also a sampler. Depends on what sampler actually means.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it means non-predictive. And something like PolytopeStrategy sounds weird ..., I think I will merge this PR first and we create an issue to solve this naming problem, ok? Or perhaps just schedule a meeting ...

@jduerholt jduerholt merged commit bf2a119 into main Jan 31, 2024
10 checks passed
@jduerholt jduerholt deleted the refactor/random_strategy branch January 31, 2024 16:43
@jduerholt jduerholt restored the refactor/random_strategy branch February 27, 2024 10:00
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

Successfully merging this pull request may close these issues.

2 participants