Skip to main content

Automated experiment design and black-box optimization

Project description

obsidian logo

obsidian

Supports Python License Issues PyPI Docs Codecov

obsidian is a library for algorithmic process design and black-box optimization using AI-guided experiment design

The obsidian library offers a set of modules for designing, executing, analyzing, and visualizing algorithmic process optimization (APO) using sample-efficient strategies such as Bayesian Optimization (BO). obsidian uses highly flexible models to build internal representations of the measured system in a way that can be explored for characterization and exploited for maximization based on uncertainty estimation and exploration strategies. obsidian supports batch experimentation (joint optimization and parallel evaluation) and is highly configurable for varying use cases, although the default specifications are encouraged.

We thank you for your patience and invite you to collaborate with us while obsidian is in beta!

Key Features

  1. End-User-Friendly: Designed to elevate the average process development scientist. No machine learning experience required.
  2. Deployable using pre-built Dash application. Each class is fully serializable, without third-party packages, to enable web-based API usage.
  3. Explainable and visualizable using SHAP analysis and interactive figures.
  4. Flexible: Handles any input (numeric, discrete) and optionally input/output constraints, multiple outcomes, batch optimization, and a variety of novelty objective compositions. We know that experiment campaigns can have fluctuating objectives and resources, and obsidian is built to support that.
  5. Purpose-Driven Development: Impactful features proposed, developed, maintained, and used by laboratory bench scientists. Revelantly designed for process development, optimization, and characterization.

How it Works: Algorithmic Optimization

The workflow for algorithmic process optimization is an iterative workflow of the following steps:

  1. Collect data
  2. Fit a model to the data and estimate uncertainty across a design space
  3. Search for new experiments and evaluate for objective and/or informational utility
  4. Design experiments where utility is maximized
  5. Repeat

The central object ob the obsidian library is the BayesianOptimizer, which can be optionally wrapped by a Campaign. A bayesian optimization has two key components that govern the optimization:

  1. The surrogate model: A black-box model which is regressed to data and used for inference. Most often a Gaussian Process (surrogate='GP').
  2. The acquisition function: A mathematical description of the quality of potential experiments, as it pertains to optimization. Most often Expected Improvement (acquisition=['EI']).

Usage Example

Specify Parameters & Initialize a Design

from obsidian import Campaign, ParamSpace, Target
from obsidian.parameters import Param_Categorical, Param_Ordinal, Param_Continuous

params = [
    Param_Continuous('Temperature', -10, 30),
    Param_Continuous('Concentration', 10, 150),
    Param_Continuous('Enzyme', 0.01, 0.30),
    Param_Categorical('Variant', ['MRK001', 'MRK002', 'MRK003']),
    Param_Ordinal('Stir Rate', ['Low', 'Medium', 'High']),
    ]

X_space = ParamSpace(params)
target = Target('Yield', aim='max')
campaign = Campaign(X_space, target)
X0 = campaign.designer.initialize(10, 'LHS', seed=0)
Temperature Concentration Enzyme Variant Stir Rate
0 8 17 0.1405 MRK001 Medium
1 12 143 0.1695 MRK003 Medium
2 4 101 0.2855 MRK002 High
3 28 87 0.1115 MRK002 Low
4 -4 115 0.2275 MRK001 Low
5 -8 73 0.0825 MRK002 Medium
6 20 129 0.0535 MRK001 High
7 24 31 0.2565 MRK002 Medium
8 16 59 0.1985 MRK003 High
9 0 45 0.0245 MRK003 Low

Collect Data and Fit the Optimizer

campaign.add_data(Z0)
campaign.fit()

Suggest New Experiments

campaign.optimizer.suggest(m_batch=2)
Temperature Concentration Enzyme Variant Stir Rate Yield (pred) Yield lb Yield ub aq Method aq Value
0 -10 10 0.0918096 MRK001 Medium 112.497 102.558 122.436 EI 0.848569
1 -10 150 0.0882423 MRK002 High 89.8334 79.8589 99.8079 EI 0.870511

Installation

The latest obsidian release can be installed using pip:

pip install obsidian-apo

To install the required dependencies for running the Dash app:

pip install obsidian-apo[app]

Be sure to pip install in a newly created conda environment to avoid dependency conflicts.

Contributing

See CONTRIBUTING to learn more.

Developers

Contributors

  • Ajit Vikram (Merck & Co., Inc.)
  • Melodie Christensen (Merck & Co., Inc.)
  • Kobi Felton (Merck & Co., Inc.)

License

obsidian is licensed by the GPLv3 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidian_apo-0.8.3.tar.gz (105.1 kB view details)

Uploaded Source

Built Distribution

obsidian_apo-0.8.3-py3-none-any.whl (136.0 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_apo-0.8.3.tar.gz.

File metadata

  • Download URL: obsidian_apo-0.8.3.tar.gz
  • Upload date:
  • Size: 105.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1025-azure

File hashes

Hashes for obsidian_apo-0.8.3.tar.gz
Algorithm Hash digest
SHA256 8cf27008d2d71ef6ef1735e21eecb605f241d480e80008f5077257933ab0ad26
MD5 cf00ac1102d4946e9c139115a7ebbbdb
BLAKE2b-256 30e3c97dca6d603c18884fbca879aa0690be1af4021e13e45aa9ccf73fb1818a

See more details on using hashes here.

File details

Details for the file obsidian_apo-0.8.3-py3-none-any.whl.

File metadata

  • Download URL: obsidian_apo-0.8.3-py3-none-any.whl
  • Upload date:
  • Size: 136.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1025-azure

File hashes

Hashes for obsidian_apo-0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d74ab0999b447260bd0a6b6cfe0e9572fda5d15349241a92930454701ce786b
MD5 ac8374b0e7217807f3ca66c8565f5f1c
BLAKE2b-256 9277c05de3f92e37f9e8ccd7855121ea2c85d0a6ad1a7558de7de3ada120ba74

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page