Skip to main content

Bayesian optimization for continuous and categorical variables

Project description

build Documentation Status License

Gryffin: Bayesian Optimization of Continuous and Categorical Variables

Welcome to Gryffin!

Designing functional molecules and advanced materials requires complex design choices: tuning continuous process parameters such as temperatures or flow rates, while simultaneously selecting catalysts or solvents.

To date, the development of data-driven experiment planning strategies for autonomous experimentation has largely focused on continuous process parameters despite the urge to devise efficient strategies for the selection of categorical variables. Here, we introduce Gryffin, a general purpose optimization framework for the autonomous selection of categorical variables driven by expert knowledge.

Features

  • Gryffin extends the ideas of the Phoenics optimizer to categorical variables. Phoenics is a linear-scaling Bayesian optimizer for continuous spaces which uses a kernel regression surrogate. Gryffin extends this approach to categorical and mixed continuous-categorical spaces.
  • Gryffin is linear-scaling appraoch to Bayesian optimization, whose acquisition function natively supports batched optimization. Gryffin's acquisition function uses an intuitive sampling parameter to bias its behaviour between exploitation and exploration.
  • Gryffin is capable of leveraging expert knowledge in the form of physicochemical descriptors to enhance its optimization performance (static formulation). Also, Gryffin can refine the provided descriptors to further accelerate the optimization (dynamic formulation) and foster scientific understanding.

Use cases of Gryffin/Phoenics

Requirements

  • Python version >= 3.7

Installation

To install gryffin from PyPI:

$ pip install gryffin

To install gryffin from source:

$ git clone git@github.com:aspuru-guzik-group/gryffin.git
$ cd gryffin
$ pip install .

Example Usage

This is a minimalist example of Gryffin in action.

    from gryffin import Gryffin
    import experiment

    # load config
    config = {
        "parameters": [
            {"name": "param_0", "type": "continuous", "low": 0.0, "high": 1.0},
        ],
        objectives: [
            {"name": "obj", "goal": "min"},
        ]
    }

    # initialize gryffin
    gryffin = Gryffin(
        config_dict=config
    )

    observations = [] 
    for iter in range(ITER_BUDGET):

        # query gryffin for new params
        params  = gryffin.recommend(observations=observations)

        # evaluate the proposed parameters
        merit = experiment.run(params)
        params['obj'] = merit

        observations.append(params)

Documentation

Please refer to the documentation website for:

Citation

If you found Gryffin useful, please include the relevant citation in your work.

License

Apache License 2.0

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

gryffin-1.0.0.tar.gz (372.3 kB view details)

Uploaded Source

File details

Details for the file gryffin-1.0.0.tar.gz.

File metadata

  • Download URL: gryffin-1.0.0.tar.gz
  • Upload date:
  • Size: 372.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for gryffin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 013d534047b8b12626015be75eba0be0dcc8463dfc58e21b198eb378a54a0948
MD5 c4dc0e0e6638a0e1bd4b8f668bf19f14
BLAKE2b-256 502afcc3b0f9558d19d2083c284ddbad49261843704af81e7bb72d2500db18e0

See more details on using hashes here.

Supported by

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