Skip to content

Commit

Permalink
Merge pull request #57 from thomaswmorris/friendly-dofs-and-objs
Browse files Browse the repository at this point in the history
More user-friendly controls
  • Loading branch information
thomaswmorris authored Jan 30, 2024
2 parents 0b4eccd + 0af49dc commit 6eadfc1
Show file tree
Hide file tree
Showing 32 changed files with 1,293 additions and 1,112 deletions.
4 changes: 4 additions & 0 deletions blop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from . import utils # noqa F401
from ._version import get_versions
from .agent import Agent # noqa F401
from .dofs import DOF # noqa F401
from .objectives import Objective # noqa F401

__version__ = get_versions()["version"]
del get_versions
866 changes: 438 additions & 428 deletions blop/bayesian/agent.py → blop/agent.py

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions blop/bayesian/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from .agent import * # noqa F401
from .dofs import * # noqa F401
from .objectives import * # noqa F401
16 changes: 7 additions & 9 deletions blop/bayesian/acquisition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@


def parse_acq_func_identifier(identifier):
acq_func_name = None
for _acq_func_name in config.keys():
if identifier.lower() in config[_acq_func_name]["identifiers"]:
acq_func_name = _acq_func_name

if acq_func_name is None:
raise ValueError(f'Unrecognized acquisition function identifier "{identifier}".')

return acq_func_name
for acq_func_name in config.keys():
if identifier.lower() in config[acq_func_name]["identifiers"]:
return acq_func_name
return None


def get_acquisition_function(agent, identifier="qei", return_metadata=True, verbose=False, **acq_func_kwargs):
Expand All @@ -35,6 +30,9 @@ def get_acquisition_function(agent, identifier="qei", return_metadata=True, verb
"""

acq_func_name = parse_acq_func_identifier(identifier)
if acq_func_name is None:
raise ValueError(f'Unrecognized acquisition function identifier "{identifier}".')

acq_func_config = config["upper_confidence_bound"]

if config[acq_func_name]["multitask_only"] and (len(agent.objectives) == 1):
Expand Down
271 changes: 0 additions & 271 deletions blop/bayesian/dofs.py

This file was deleted.

Loading

0 comments on commit 6eadfc1

Please sign in to comment.