Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logic for running a decision making loop #365

Conversation

Thomas-Christie
Copy link
Contributor

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've formatted the new code by running poetry run pre-commit run --all-files --show-diff-on-failure before committing.
  • I've added tests for new code.
  • I've added docstrings for the new code.

Description

Add logic for running a decision making loop

Added an AbstractDecisionMaker abstract base class which can be
implemented in order to define a decision making loop.

A concrete implementation, in the form of a DecisionMaker class,
has been added. At its heart it has two core methods:

  1. ask which is used to get a point to be queried next.
  2. tell which is used to tell the DecisionMaker about new
    observations. In a typical decision making setup this will result in
    the datsets and posteriors being updated.

In addition to this, in the DecisionMaker a run method is provided,
which will automatically run the decision making loop for n steps. After
the ask step, the functions in the post_ask list will be executed,
taking as arguments the decision maker and the point chosen to be
queried next. Similarly, after the tell step, the functions in
the post_tell list are executed, taking the decision maker as the sole
argument.

Also removed the check for type-checking import warnings (TCH) from Ruff in pyproject.toml.

Issue Number: N/A

Added an `AbstractDecisionMaker` abstract base class which can be
implemented in order to define a decision making loop.

A concrete implementation, in the form of a `DecisionMaker` class,
has been added. At its heart it has two core methods:
1. `ask` which is used to get a point to be queried next.
2. `tell` which is used to tell the `DecisionMaker` about new
   observations. In a typical decision making setup this will result in
   the datsets and posteriors being updated.

In addition to this, in the `DecisionMaker` a `run` method is provided,
which will automatically run the decision making loop for n steps. After
the `ask` step, the functions in the `post_ask` list will be executed,
taking as arguments the decision maker and the point chosen to be
queried next. Similarly, after the `tell` step, the functions in
the `post_tell` list are executed, taking the decision maker as the sole
argument.
Copy link
Contributor

@henrymoss henrymoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just a couple Qs about organisation here

Implemented minor CR feedback and renamed acquisition functions to
utility functions to reflect the fact that the package will be used for
general Bayesian decision making and not just Bayesian optimisation.
@Thomas-Christie Thomas-Christie merged commit a23af63 into JaxGaussianProcesses:tchristie/bo Sep 1, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants