dflemin3 / approxposterior

A Python package for approximate Bayesian inference and optimization using Gaussian processes
https://dflemin3.github.io/approxposterior/
MIT License
41 stars 9 forks source link

Add bounds, scale to ApproxPosterior object? #44

Closed dflemin3 closed 5 years ago

dflemin3 commented 5 years ago

It could be useful, and make the code cleaner, to have both bounds and scale be initialized with the ApproxPosterior object. Bounds is used in numerous places to maintain numerically stability and validate point selection. Scaling parameters is used throughout now, as well, so it could make sense to initialize the scaler earlier on. Also, this could allow for the user to select several common scales, like MinMax, Normal, etc, using the sklearn interface. MinMax is easy to initialize with bounds for training the scaler, but Normal and other types of scaling requires fitting on training data, which in our case, could be the initial theta.

I can get around breaking the API by allowing the user to override bounds in the ApproxPosterior run method and with sensible default choices for both scale and bounds.

dflemin3 commented 5 years ago

I added bounds to the AP initialization as a required argument and nixed scaling since it didn't obviously help performance.