Skip to content

How to optimize of percentage inputs #1301

Answered by saitcakmak
taikichi-pc asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @taikichi-pc. optimize_acqf takes in an equality_constraints argument, though there seems to be a bug with this: #1227.

In your case, the constraint is quite simple, so you could do define a simple wrapper (a sub-class in this case) around the acquisition function, which takes in 2-dimensional inputs and appends the last input before evaluating the acquisition function. You'd then optimize this via optimize_acqf, using the bounds for the first two dimensions and using an inequality_constraint that makes sure that the sum of the two is <= 100. Something like:

class WrappedAcqf(qNoisyExpectedImprovement):  # replace with the acquisition function you want to use
    def forward(self, X: T…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@taikichi-pc
Comment options

Answer selected by saitcakmak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants