trieste

A Bayesian optimization toolbox built on TensorFlow

https://github.com/secondmind-labs/trieste

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    1 of 27 committers (3.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A Bayesian optimization toolbox built on TensorFlow

Basic Info
  • Host: GitHub
  • Owner: secondmind-labs
  • License: apache-2.0
  • Language: Python
  • Default Branch: develop
  • Size: 190 MB
Statistics
  • Stars: 239
  • Watchers: 10
  • Forks: 44
  • Open Issues: 77
  • Releases: 50
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

Trieste

PyPI License Release Develop Codecov Slack Status

Documentation (develop) | Documentation (release) | Tutorials | API reference |

What does Trieste do?

Trieste (pronounced tree-est) is a Bayesian optimization toolbox built on TensorFlow. Trieste is named after the bathyscaphe Trieste, the first vehicle to take a crew to Challenger Deep in the Mariana Trench, the lowest point on the Earth’s surface: the literal global minimum.

Why Trieste?
- Highly modular design and easily customizable. Extend it with your custom model or acquisition functions. Ideal for practitioners that want to use it in their systems or for researchers wishing to implement their latest ideas. - Seamless integration with TensorFlow. Leveraging fully its auto differentiation - no more writing of gradients for your acquisition functions!, and scalability capabilities via its support for highly parallelized modern hardware (e.g. GPUs). - General purpose toolbox. Advanced algorithms covering all corners of Bayesian optimization and Active learning - batch, asynchronous, constraints, multi-fidelity, multi-objective - you name it, Trieste has it. - Versatile model support out-of-the-box. From gold-standard Gaussian processes (GPs; GPflow) to alternatives like sparse variational GPs, Deep GPs (GPflux) or Deep Ensembles (Keras), that scale much better with the number of function evaluations. - Real-world oriented. Our Ask-Tell interface allows users to apply Bayesian optimization across a range of non-standard real-world settings where control over black-box function is partial. Built on TensorFlow and with comprehensive testing Trieste is production-ready.

Getting started

Here's a quick overview of the main components of a Bayesian optimization loop. For more details, see our Documentation where we have multiple Tutorials covering both the basic functionalities of the toolbox, as well as more advanced usage.

Let's set up a synthetic black-box objective function we wish to minimize, for example, a popular Branin optimization function, and generate some initial data ```python from trieste.objectives import Branin, mk_observer

observer = mk_observer(Branin.objective)

initialquerypoints = Branin.searchspace.sample(5) initialdata = observer(initialquerypoints) ```

First step is to create a probabilistic model of the objective function, for example a Gaussian Process model ```python from trieste.models.gpflow import build_gpr, GaussianProcessRegression

gpflowmodel = buildgpr(initialdata, Branin.searchspace) model = GaussianProcessRegression(gpflow_model) ```

Next ingredient is to choose an acquisition rule and acquisition function ```python from trieste.acquisition import EfficientGlobalOptimization, ExpectedImprovement

acquisition_rule = EfficientGlobalOptimization(ExpectedImprovement()) ```

Finally, we optimize the acquisition function using our model for a number of steps and we check the obtained minimum ```python from trieste.bayesian_optimizer import BayesianOptimizer

bo = BayesianOptimizer(observer, Branin.searchspace) numsteps = 15 result = bo.optimize(numsteps, initialdata, model) querypoint, observation, argminidx = result.trygetoptimalpoint() ```

Installation

Trieste supports Python 3.9+ and TensorFlow 2.5+, and uses semantic versioning.

For users

To install the latest (stable) release of the toolbox from PyPI, use pip: bash $ pip install trieste or to install from sources, run bash $ pip install . in the repository root.

For contributors

To install this project in editable mode, run the commands below from the root directory of the trieste repository. bash git clone https://github.com/secondmind-labs/trieste.git cd trieste pip install -e . For installation to be able to run quality checks, as well as other details, see the guidelines for contributors.

Tutorials

Trieste has a documentation site with tutorials on how to use the library, and an API reference. You can also run the tutorials interactively. They can be found in the notebooks directory, and are written as Python scripts for running with Jupytext. To run them, first install trieste from sources as above, then install additional dependencies with bash $ pip install -r notebooks/requirements.txt Finally, run the notebooks with bash $ jupyter-notebook notebooks

Alternatively, you can copy and paste the tutorials into fresh notebooks and avoid installing the library from source. To ensure you have the required plotting dependencies, simply run: bash $ pip install trieste[plotting]

Importing Keras

Like tensorflow-probability, Trieste currently uses Keras 2. When using Tensorflow versions 2.16 onwards (which default to Keras 3) this needs to be imported from tf_keras rather than tf.keras. Alternatively, for a shortcut that works with all versions of Tensorflow, you can write: python from gpflow.keras import tf_keras

The Trieste Community

Getting help

Bugs, feature requests, pain points, annoying design quirks, etc: Please use GitHub issues to flag up bugs/issues/pain points, suggest new features, and discuss anything else related to the use of Trieste that in some sense involves changing the Trieste code itself. We positively welcome comments or concerns about usability, and suggestions for changes at any level of design. We aim to respond to issues promptly, but if you believe we may have forgotten about an issue, please feel free to add another comment to remind us.

Slack workspace

We have a public Secondmind Labs slack workspace. Please use this invite link and join the #trieste channel, whether you'd just like to ask short informal questions or want to be involved in the discussion and future development of Trieste.

Contributing

All constructive input is very much welcome. For detailed information, see the guidelines for contributors.

Citing Trieste

To cite Trieste, please reference our arXiv paper where we review the framework and describe the design. Sample Bibtex is given below:

@misc{trieste2023, author = {Picheny, Victor and Berkeley, Joel and Moss, Henry B. and Stojic, Hrvoje and Granta, Uri and Ober, Sebastian W. and Artemev, Artem and Ghani, Khurram and Goodall, Alexander and Paleyes, Andrei and Vakili, Sattar and Pascual-Diaz, Sergio and Markou, Stratis and Qing, Jixiang and Loka, Nasrulloh R. B. S and Couckuyt, Ivo and Morter, Chris}, title = {Trieste: Efficiently Exploring The Depths of Black-box Functions with TensorFlow}, publisher = {arXiv}, year = {2023}, doi = {10.48550/ARXIV.2302.08436}, url = {https://arxiv.org/abs/2302.08436} }

License

Apache License 2.0

Owner

  • Name: Secondmind Labs
  • Login: secondmind-labs
  • Kind: organization
  • Location: Cambridge, UK

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Picheny"
  given-names: "Victor"
- family-names: "Berkeley"
  given-names: "Joel"
- family-names: "Moss"
  given-names: "Henry B."
- family-names: "Stojic"
  given-names: "Hrvoje"
- family-names: "Granta"
  given-names: "Uri"
- family-names: "Ober"
  given-names: "Sebastian W."
- family-names: "Artemev"
  given-names: "Artem"
- family-names: "Ghani"
  given-names: "Khurram"
- family-names: "Goodall"
  given-names: "Alexander"
- family-names: "Paleyes"
  given-names: "Andrei"
- family-names: "Vakili"
  given-names: "Sattar"
- family-names: "Pascual-Diaz"
  given-names: "Sergio"
- family-names: "Markou"
  given-names: "Stratis"
- family-names: "Qing"
  given-names: "Jixiang"
- family-names: "Loka"
  given-names: "Nasrulloh R. B. S"
- family-names: "Couckuyt"
  given-names: "Ivo"
- family-names: "Morter"
  given-names: "Chris"
title: "Trieste"
version: 4.5.1
date-released: 2025-05-23
url: "https://github.com/secondmind-labs/trieste"

GitHub Events

Total
  • Create event: 43
  • Release event: 6
  • Issues event: 7
  • Watch event: 14
  • Delete event: 22
  • Member event: 1
  • Issue comment event: 19
  • Push event: 112
  • Pull request review comment event: 74
  • Pull request event: 50
  • Pull request review event: 79
  • Fork event: 4
Last Year
  • Create event: 43
  • Release event: 6
  • Issues event: 7
  • Watch event: 14
  • Delete event: 22
  • Member event: 1
  • Issue comment event: 19
  • Push event: 112
  • Pull request review comment event: 74
  • Pull request event: 50
  • Pull request review event: 79
  • Fork event: 4

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 438
  • Total Committers: 27
  • Avg Commits per committer: 16.222
  • Development Distribution Score (DDS): 0.667
Top Committers
Name Email Commits
uri-granta 5****a@u****m 146
Joel Berkeley 1****y@u****m 69
Henry Moss 3****s@u****m 58
Hrvoje Stojic h****c@p****m 44
vpicheny v****y@u****m 18
Andrei Paleyes a****s@u****m 17
Joel Berkeley j****y@s****i 13
sebastianober s****r@g****m 12
Qing jixiang t****g@y****m 9
AlexGoodallAI 1****I@u****m 8
Loka s****a@g****m 8
tensorlicious 5****s@u****m 5
joelberkeley-pio j****y@p****o 4
Uri Granta u****a@s****i 4
Khurram Ghani 1****i@u****m 4
Stratis Markou s****r@g****m 3
Uri Granta u****a@s****o 2
Jesper Nielsen 4****e@u****m 2
Alessandro Vullo a****o@p****o 2
Vincent Dutordoir d****v@g****m 2
st-- s****-@u****m 2
Artem Artemev a****0@i****k 1
Ikko Eltociear Ashimine e****r@g****m 1
John Mcleod 4****d@u****m 1
Chris Morter c****s@p****o 1
jamesrobson-secondmind 4****d@u****m 1
Serge K n****v@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 95
  • Total pull requests: 323
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 21 days
  • Total issue authors: 33
  • Total pull request authors: 19
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.41
  • Merged pull requests: 242
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 7
  • Pull requests: 84
  • Average time to close issues: N/A
  • Average time to close pull requests: 11 days
  • Issue authors: 6
  • Pull request authors: 6
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.27
  • Merged pull requests: 54
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • joelberkeley-secondmind (16)
  • joelberkeley (15)
  • uri-granta (13)
  • hstojic (11)
  • khurram-ghani (6)
  • vpicheny (3)
  • henrymoss (3)
  • apaleyes (2)
  • ioananikova (2)
  • AmosJoseph (1)
  • FrancoisGallard (1)
  • vschram (1)
  • BinglinW (1)
  • markvdw (1)
  • E-Isnard (1)
Pull Request Authors
  • uri-granta (204)
  • khurram-ghani (47)
  • hstojic (24)
  • ChrisMorter (11)
  • AlexGoodallAI (10)
  • avullo (6)
  • liyuan9988 (3)
  • henrymoss (3)
  • TsingQAQ (2)
  • nfergu (2)
  • sebastianober (2)
  • vpicheny (2)
  • st-- (1)
  • sam-willis (1)
  • eltociear (1)
Top Labels
Issue Labels
bug (37) enhancement (34) documentation (12) code quality (4) question (3)
Pull Request Labels
bug (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,156 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 49
  • Total maintainers: 2
pypi.org: trieste

A Bayesian optimization research toolbox built on TensorFlow

  • Versions: 49
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 1,156 Last month
Rankings
Dependent packages count: 4.8%
Stargazers count: 5.1%
Forks count: 6.5%
Downloads: 7.4%
Average: 9.1%
Dependent repos count: 21.5%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/deploy.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/develop-checks.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/develop-deploy.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/quality-checks.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
common_build/format/requirements.txt pypi
  • black *
  • click *
  • flake8 *
  • isort *
  • typing-extensions *
common_build/taskipy/requirements.txt pypi
  • click *
  • pylint *
  • pytest *
  • pytest-black *
  • pytest-cov *
  • pytest-flake8 *
  • pytest-isort *
  • pytest-mypy *
  • pytest-pylint *
  • taskipy *
  • typing-extensions *
common_build/types/requirements.txt pypi
  • mypy *
  • types-PyYAML *
  • typing-extensions *
docs/notebooks/requirements.txt pypi
  • Jinja2 <3.1
  • box2d *
  • gym <0.22
  • jupyterlab *
  • jupytext *
  • matplotlib *
  • numpy *
  • pandas <1.0
  • plotly *
  • ray *
docs/requirements.txt pypi
  • Jinja2 <3.1
  • importlib-metadata <5.0
  • ipython *
  • nbsphinx *
  • pydata-sphinx-theme *
  • sphinx *
  • sphinx-autoapi *
  • sphinxcontrib-bibtex *
setup.py pypi
  • absl-py *
  • dill *
  • gpflow >=2.7.0
  • gpflux >=0.3.1
  • greenlet >=1.1.0
  • numpy *
  • tensorflow >=2.5
  • tensorflow-probability >=0.13
tests/latest/requirements.txt pypi
  • PyYAML * test
  • packaging * test
  • pytest * test
tests/old/requirements.txt pypi
  • PyYAML * test
  • packaging * test
  • pytest * test
  • tensorflow * test
  • tensorflow-probability * test
versions.json meteor
pyproject.toml pypi
.github/workflows/release-checks.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite