Probabilities of Feasibility for Classifier based constraints in Acquisition Functions #2776
+30
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Using classifiers as output constraints in MC based acquisition functions is a topic discussed at least in #725 and in #2700. The current solution is to take the probabilities from the classifier and to unsigmoid them. This is a very unintuitive approach, especially as sometimes a sigmoid and sometimes a fatmoid is used. This PR introduces a new attribute for
SampleReducingMCAcquisitionFunction
s namedprobabilities_of_feasibility
that expects a callable that returns a tensor holding values between zero and one, where one means feasible and zero infeasible.Currently, it is only implemented in the abstract
SampleReducingMCAcquisitionFunction
using the additional attribute. As theconstraints
argument is just a special case of theprobabilities_of_feasibility
argument, where the output of the callable is not directly applied to the objective but further processed by a sigmoid or fatmoid one could also think about uniting both functionalities into one argument, and modifyfat
toList[bool | None] | bool
that indicates if a fatmoid, a sigmoid or nothing is applied. When the user just provides a bool, it applies either a fatmoid or sigmoid for all. This approach would also have the advantage that onlycompute_smoothed_feasibility_indicator
needs to be modified and almost nothing for the individual acqfs (besides updating the types forconstraints
.) Furthermore, it follows the approach that we took when we implemented individualeta
s for the constraints. So I would favor this one in contrast to the one actually outlined in the code ;) I am looking forward to you ideas on this.@SebastianAment: In #2700, you mention that from your perspective the
probabilities_of_feasibility
would not be applied on a per sample basis as the regular constraints. Why? Also in the community notebook by @FrankWanger using the unsigmoid trick it is applied on a per sample basis. I would keep it on the per sample basis and if a classifier for some reason do not returns the probabilities on a per sample basis, it would be the task of the user to expand the tensor accordingly. What do you think?Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
Unit test, but not yet added due to the draft status and pending architecture choices.
cc: @Balandat