Simple TS implementation #1681
-
Thank you for your previous kind reply. I'd like to implement TS(Thompson sampling) baseline for comparing with other acquisition function. How would you implement TS using botorch as a simple(basic) code? I've already read bellow links. BTW COMBO, another BO library, and so on adopt TS as a default algorithm for Multi-objective. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Take a look at Note that this draws samples at some discrete set of points |
Beta Was this translation helpful? Give feedback.
Take a look at
MaxPosteriorSampling
- this is Thompson sampling. The support for batched models makes it a bit less readable and there a some tensor acrobatics necessary if you want to avoid duplicated samples in that setting, but overall it's pretty straightforward.Note that this draws samples at some discrete set of points
X
. Another implementation would be to draw sample paths from the model posterior (using the pathwise sampling feature added in #1463), and then optimize each of them individually using some gradient-based scheme. This is currently not (yet) implemented though.