secondmind-labs / trieste

A Bayesian optimization toolbox built on TensorFlow
Apache License 2.0
219 stars 42 forks source link

Make AskTellOptimizer generic in how model updates are handled #815

Closed uri-granta closed 8 months ago

uri-granta commented 8 months ago

Related issue(s)/PRs: resolves #814

Summary

Generalize AskTellOptimizer so that we can use it with non-trainable models.

  1. AskTellOptimizer works as before (and still requires trainable models)
  2. AskTellOptimizerNoTraining does no training at tell time and during initialization (and supports all models).
  3. New AskTellOptimizerABC subclasses can be defined to incorporate other model handling into the tell stage.

Fully backwards compatible: no

Runtime behaviour unchanged, but Record, FrozenRecord and OptimizationResult are now also generic in the model type, which could affect type checking type-annotated code. The fix is to add model type annotations were appropriate.

PR checklist