Conversation
bertiqwerty
left a comment
There was a problem hiding this comment.
Thanks Johannes! Can you please add an example that shows how this can be used? I think this is especially important since a step-wise strategy with the FeasibleExperimentCondition should be combined with the pf-acquisition-function.
| constraints in the next batch. It can be only used in the SoboStrategy | ||
| and is especially useful in combination with the FeasibleExperimentCondition | ||
| within the StepwiseStrategy. | ||
|
|
There was a problem hiding this comment.
Is there a literature reference that you can add?
There was a problem hiding this comment.
No, this is based on the BoFire PR, in which they implemented it: meta-pytorch/botorch#2815
There was a problem hiding this comment.
Would it make sense to add a link to this paper mentioned in the BoTorch API reference and a link to the BoTorch API reference itself?
There was a problem hiding this comment.
The paper does not really fit, it does not mention the new acqf and is just explaining why one should use log based acqfs ;)
There was a problem hiding this comment.
This is the formula for constrained expected improvement, which we were using automatically when we use EI in combination with output constraints. This PR introduced the qLogPF (PF = Probabiliy of feasibility) acquisition function which is just the feasibility term without EI.
There was a problem hiding this comment.
Aaaah. Got it. Now your new documentation (strategies.md) makes sense to me :D.
| qLogPF, | ||
| ] | ||
|
|
||
| AnySingleObjectiveAcquisitionFunction = Union[ |
There was a problem hiding this comment.
didn't you say above this was a single objective acquisition function? shouldn't it appear here?
There was a problem hiding this comment.
It is kind of a special case of a single objective acqf, as it should be only used for SoboStrategy but not for the other SoboStrategys like AdditiveSoboStrategy etc. This is why I implemented it in this way. Do you have a better idea? I know, it is not ideal ...
| def validate_is_singleobjective(cls, v, values): | ||
| if len(v.outputs) == 1: | ||
| return v | ||
| acquisition_function: Union[AnySingleObjectiveAcquisitionFunction, qLogPF] = Field( |
There was a problem hiding this comment.
see my comment above.
| relevant_constraints.is_fulfilled(valid_experiments) | ||
| ] | ||
|
|
||
| # TODO: have a is fulfilled for input features --> work for future PR |
There was a problem hiding this comment.
rather use issues than comments in the code.
There was a problem hiding this comment.
done: #593
I let the comment in the code so that one knows where to add it in the code.
| def __init__( | ||
| self, | ||
| data_model: SoboBaseDataModel, | ||
| data_model: SoboDataModel, |
There was a problem hiding this comment.
why did you change this? multiplicative or additive pass their data model here which is an heir of SoboBaseDataModel.
There was a problem hiding this comment.
It was due to some typing errors, which were occuring due the change on the type of the ACQF. And of course, changing it how it is now, also again introduces tying errors. As told above: I am very open for a better solution.
Co-authored-by: Behrang Shafei <50267830+bertiqwerty@users.noreply.github.com>
|
Thanks for the review @bertiqwerty, I have let comments on your comments. Maybe you have an idea regarding one typing issue.
I find adding another notebook for every new feature a bit too much. What do you think about examples in the docstring? Or what would you recommend? |
I didn't say you need a new notebook. I like examples in the doc-strings. But we should then also test them. You could also add this to another existing notebook. But without example it is always hard to understand what something is for. |
|
@bertiqwerty: will make up my mind where to add the example. Any idea regarding the typing etc.? |
|
Hi @bertiqwerty, I created a new documentation page, which gives a still very rough overview on strategies, in which also the concept of stepwise strategies is documented with an example for the new acqf. This documentation can be still improved, but I did not found time to do so. So there is enough material for future PRs ;) I also switched to a different solution regarding exclusion of the ACQF for the other strategies. It is not perfect, but better then the old one which was causing a lot of typing problems. And honestly, I do not have time for more there ... So it is ready for re-review ;) |
|
|
||
| class _ForbidPFMixin: | ||
| """ | ||
| Mixin to forbid the use of qLogPF acquisition function in strategies that are not |
There was a problem hiding this comment.
You mean single-objective botorch strategies that are not sobo, right?
There was a problem hiding this comment.
Good point, I will make it more clear and merge.


Motivation
This PR adds the probability of feasibility ACQF from botorch. It is automatically used in MOBO and SOBO optimizations when no feasibile solution is there.
Update 23.05.2025:
It is not anymore used automatically in the SOBO and MOBO. Instead it is now a selectable ACQF for
SoboStrategy. To use it dynamically it can be applied in theStepwiseStrategytogether with respecting condition introduced in this PR.Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
Unit tests.