experimental-design / bofire

Experimental design and (multi-objective) bayesian optimization.
https://experimental-design.github.io/bofire/
BSD 3-Clause "New" or "Revised" License
207 stars 22 forks source link

gp output scaler #309

Closed simonsung06 closed 9 months ago

simonsung06 commented 10 months ago

Added output scaler option for GP's

There is repeated code for the Pydantic validator so we probably need to think about a better way to do this in the future.

simonsung06 commented 9 months ago

Hi Johannes. That is a possible idea about would be suitable for now I think. I'm not sure about how pydantic2 works though and how it changes things...

For now I'll make your suggested change and commit it when i get the chance

simonsung06 commented 9 months ago

Hi @jduerholt,

I've made the suggested change by adding a new TrainableBotorchSurrogate data model.

In addition, the random forest data model was also modified because it originally inherits from BotorchSurrogate and TrainableSurrogate too. Whilst this is not completely necessary, I changed it to inherit TrainableBotorchSurrogate so RandomForestSurrogate will now also take scaler and output_scalar keywords arguments, which both default to ScalerEnum.IDENTITY. This meant changing the loads and dumps functions so that torch type scalers could be dumped and loaded if they are used.

jduerholt commented 9 months ago

Thx, I will have a look over the course of the week!