Skip to main content

Uncertainty quantification for neural network models of chemical systems.

Project description

unlockNN

Documentation Status PyPi status made-with-python License: MIT Code style: black codecov

A Python package for interpreting and extracting uncertainties in neural network models of chemical systems based upon Gaussian processes.

Statement of need

Neural networks (NNs) are powerful tools for materials property prediciton (MPP) based on structural information. After training, they offer a cheaper alternative to density function theory (DFT) and are therefore promising for high throughput screening of materials. However, most current implementations of NNs for MPP lack uncertainty quantifiers. Knowledge of the certainty in an estimate is particularly important for machine learning models, as the reliability of a prediction depends on the existence of functionally similar structures in the training dataset, which cannot be readily determined.

UnlockNN contains utilities for adding uncertainty quantification to Keras-based models. This is achieved by replacing the last layer of the model with a variational Gaussian process (VGP), a modification of a Gaussian process that improves scalability to larger data sets. The caveat is that the modified model must undergo further training in order to calibrate the uncertainty quantifier; however, this typically only requires a small number of training iterations.

UnlockNN also contains a specific configuration for adding uncertainty quantification to MEGNet: a powerful graph NN model for predicting properties of molecules and crystals.

Installation

The package can be installed by cloning this repository and building it using either anaconda or pip, or it can be downloaded directly from PyPi.

To install from PyPi, run pip install unlockNN. To install from source:

git clone https://github.com/a-ws-m/unlockNN.git
cd unlockNN
conda env create -f environment.yml  # Optional: create a virtual environment with conda
pip install .

The dev_environment.yml contains additional dependencies for development, testing and building documentation. It can be installed using conda env create -f dev_environment.yml.

Documentation

Full documentation is available for the project here.

Benchmarks

Benchmark details and results can be found in the benchmarking subdirectory.

License and attribution

Code licensed under the MIT License.

Development notes

Reporting issues

Please use the Issue tracker to report bugs in the software, suggest feature improvements, or seek support.

Contributing to unlockNN

Contributions are very welcome as we look to make unlockNN more flexible and efficient. Please use the Fork and Pull workflow to make contributions and follow the contribution guidelines:

  • Use the environment defined in dev_environment.yml. This installs black, the formatter used for this project, as well as utilities for building documentation (sphinx and the insegel theme), enabling the testing suite (pytest and pytest-cov) and publishing to PyPi (build, but this will be handled by the package maintainer).
  • Use black to format all Python files that you edit: black {edited_file.py} or python -m black {edited_file.py}.
  • Write tests for new features in the appropriate directory. Run tests using pytest tests/, or optionally with pytest --cov=unlocknn tests/ to generate coverage on the fly.
  • After testing that pytest works for your current environment, run tox in the root directory of the project to check that all versions of Python are compatible.
  • Use Google-style Docstrings. Check docstrings with pydocstyle: pydocstyle {edited_file.py}.
  • Check docstrings are valid Sphinx RST and that the documentation compiles without errors: in the docs directory, run make html.
  • Feel free to clean up others' code as you go along.

List of developers

Contributors to unlockNN:

Huge thanks to Keith Butler, Aron Walsh and Kazuki Morita for supervising the project at its inception and for their immense support.

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

unlockNN-2.0.3.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

unlockNN-2.0.3-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file unlockNN-2.0.3.tar.gz.

File metadata

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

File hashes

Hashes for unlockNN-2.0.3.tar.gz
Algorithm Hash digest
SHA256 7f8eabccd1a48925fd199227f62830e7714614747f0bf6f872bb39e05a1cd596
MD5 d3d8ec2de6e1c21852f1e83ce30004f4
BLAKE2b-256 b394391af8a0a38c259733cc702fb5fde5a49219367a82b92edaf7047fd96e22

See more details on using hashes here.

File details

Details for the file unlockNN-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: unlockNN-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for unlockNN-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ebe4d5814245d304125d3540b4063d140917a7666e5ead84121f1ec4df7990
MD5 20a3cb6df166d0c9595352bdd2b6a33a
BLAKE2b-256 2b9a399b644d5ea1604fc5c935e1776d98065a6ba3d8a208380dac5f9b008c25

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