UnlockNN
A Python package for adding uncertainties to neural network models of chemical systems.
Install / Use
/learn @a-ws-m/UnlockNNREADME
unlockNN
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 installsblack, the formatter used for this project, as well as utilities for building documentation (sphinxand theinsegeltheme), enabling the testing suite (pytestandpytest-cov) and publishing to PyPi (build, but this will be handled by the package maintainer). - Use
blackto format all Python files that you edit:black {edited_file.py}orpython -m black {edited_file.py}. - Write tests for new features in the appropriate directory. Run tests using
pytest tests/, or optionally withpytest --cov=unlocknn tests/to generate coverage on the fly. - After testing that
pytestworks for your current environment, runtoxin 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
docsdirectory, runmake 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.
Related Skills
claude-opus-4-5-migration
106.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
345.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
50.6k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.8kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
