-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Documentation] Incomplete documentation for implementing custom models #2427
Comments
Thanks for the feedback! (And for those collapsible stack traces -- very easy to navigate.) A few thoughts that might help:
I'm also curious what your use case is and whether it might be possible to accomplish it without a custom model at all. For example, if you wanted to use a custom kernel, you could pass that as the Some to-dos for improving BoTorch:
|
Hi @esantorella, Thanks for the response. I have subclassed Specifically for qNEI and similar acquisition functions, it doesn't matter whether you provide a My use case is a non-GP surrogate, hence there was not a lot of existing machinery that I could reuse. For instance, the base samples of this model are uniformly distributed rather than normally, so I had to define uniform Sobol and IID samplers (which are obviously very similar to the samplers in |
I looked into whether these methods could be made abstract, and unfortunately most of them can't, since there are a good number of existing subclasses that don't implement those methods. I do think the
Ah yes, there's even a typecheck error telling us that only a
Makes sense! Thanks. |
The Implementing Custom Models section of the documentation makes it sound a lot more straightforward to use a custom model than it really is. So far, I've found the following extra conditions that should be mentioned (in this instance, when using
qNoisyExpectedImprovement
):The
posterior
method must accept aposterior_transform
kwarg, otherwise the following error appears:Stack trace
The model additionally requires a
num_outputs
attribute, otherwise the following error appears (related to #354):Stack trace
A posterior sampler must be registered using
@GetSampler.register(object)
, otherwise the following error appears:Stack trace
Furthermore, when not using stochastic sampling, the
Posterior
object must also implementbase_sample_shape
,batch_range
and potentially more.The text was updated successfully, but these errors were encountered: