Skip to content

Outcome constraints using constraint parameter in CEI #2117

Closed Answered by Balandat
GStechschulte asked this question in Q&A
Discussion options

You must be logged in to vote

But now, I am back to to my problem of how to impose an outcome constraint of the form lower < f(x) < upper where f is some black-box function and lower and upper are bounds that I want to enforce such that the optimization routine only proposes values that result in lower < f(x) < upper.

constraints=[
    lambda Z: Z.squeeze(-1) - upper,
    lambda Z: lower - Z.squeeze(-1),
]

should do the trick, no?

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@GStechschulte
Comment options

@sdaulton
Comment options

@GStechschulte
Comment options

@Balandat
Comment options

Answer selected by GStechschulte
@GStechschulte
Comment options

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