Allow trainable models to return an optimization result and provide a backwards compatible method to make it accessible in the models. This currently includes OptimizeResult for gpflow models using the SciPy optimizer, keras.callback.History for keras models using the keras fit method, and lists of results for model stacks.
Note that exposing this in the model makes more sense than exposing it in the optimizer wrappers, as these are essentially an implementation detail and behave very differently between e.g. gpflow and keras.
Fully backwards compatible: yes
PR checklist
[ ] The quality checks are all passing
[ ] The bug case / new feature is covered by tests
[ ] Any new features are well-documented (in docstrings or notebooks)
Related issue(s)/PRs: #617
Summary
Allow trainable models to return an optimization result and provide a backwards compatible method to make it accessible in the models. This currently includes OptimizeResult for gpflow models using the SciPy optimizer, keras.callback.History for keras models using the keras fit method, and lists of results for model stacks.
Note that exposing this in the model makes more sense than exposing it in the optimizer wrappers, as these are essentially an implementation detail and behave very differently between e.g. gpflow and keras.
Fully backwards compatible: yes
PR checklist