Description
Question
Hello, general question here. I'm working on hooking up the ECI acquisition function from the BoTorch tutorials to the Ax machinery. ECI is not part of the official BoTorch library as far as I can tell and only exists as an example/tutorial, but even that demo implementation there seems to do a good job at solving the problem I am working on. So now I want to hook it up to Ax for easier data management, saving experiments, etc. I've gone through all the required steps (mainly defining an input constructor) and have run into a couple speed bumps along the way:
- The Ax
Acquisition
wrapper class attempts to inject many arguments (see here) which may or may not be input arguments to the custom BoTorch acquisition class we're trying to plug into. For instance, in this case aposterior_transform
argument is passed, so I ended up having to add it as well to the ECI implementation even though it is not used for anything. If I don't add it, the decorated input constructor, which gets preprocessed byallow_only_specific_variable_kwargs
, throws an error. - The
Acquisition
constructor preprocesses the outcome constraints in theTorchOptConfig
container into a list ofCallable
s. It seems that many BoTorch acquisition functions (e.g. most of the ones inbotorch.acquisition.monte_carlo
) take in outcome constraints in this form, but others don't (e.g. some of theanalytic
functions that support constraints). The toy implementation of ECI assumed a different constraint format, but in this case it's simple enough for me to modify the implementation to work with callables instead.
In sum, so far it looks like I am managing to establish the connection, albeit in a somewhat hacky way. Thoughts? Am I on the right track? More generally I get the feeling that Ax's Acquisition
already makes too many assumptions and therefore subclassing it to specialize it to custom backend implementations is not a good approach, and one has to resort to hacking a bit. I saw some discussion in past issues regarding this problem and the need to refactor the API so maybe that's a good long-ish term project to increase flexibility. For now, I am happy to (eventually) put in a BoTorch MR to make ECI part of the official library if there is interest in this and once I get some pointers/feedback on my approach.
Please provide any relevant code snippet if applicable.
Code of Conduct
- I agree to follow this Ax's Code of Conduct