DimeNet++ in Jax.
Project description
Jax-DimeNet++
Haiku implementation of the DimeNet++ architecture.
Getting started
This repository provides 2 interfaces for the DimeNet++ model. The first interface allows using DimeNet++ as a Jax M.D. energy_fn to run molecular dynamics simulations. The second interface allows prediction of global molecular properties.
from jax_dimenet import dimenet, sparse_graph
# Jax M.D. energy function:
init_fn, dimenet_energy_fn = dimenet.energy_neighborlist(displacement_fn, r_cut)
init_params = init_fn(random.PRNGKey(0), positions, neighbor=neighbors)
energy_fn = partial(dimenet_energy_fn, init_params) # jax_md energy_fn interface
print('Predicted energy:', energy_fn(positions, neighbors))
# Molecular property prediction:
mol_graph, _ = sparse_graph.sparse_graph_from_neighborlist(
displacement_fn, positions, neighbors, r_cut)
init_fn, property_predictor = dimenet.property_prediction(r_cut, n_targets=5)
init_params = init_fn(random.PRNGKey(0), mol_graph)
print('Predicted properties:', property_predictor(init_params, mol_graph))
A minimum usage example is available in the notebooks folder. For more real-world applications of the DimeNet++ model in MD simulations, please refer to the DiffTRe repository.
Installation
You can install Jax-DimeNet++ via pip:
pip install jax-dimenet
Requirements
The repository uses the following packages:
MDAnalysis
jax>=0.2.12
jaxlib>=0.1.65
jax-md>=0.1.13
dm-haiku>=0.0.4
sympy
chex
The code was run with Python 3.8.
Contribution
Contributions are always welcome! Please open a pull request to discuss the code additions.
Contact
For questions, please contact stephan.thaler@tum.de.
Citation
If you use this code in your own work, please consider citing the paper that introduced this DimeNet++ implementation,
@article{thaler_difftre_2021,
title = {Learning neural network potentials from experimental data via Differentiable Trajectory Reweighting},
author = {Thaler, Stephan and Zavadlav, Julija},
journal={Nature Communications},
volume={12},
pages={6884},
doi={10.1038/s41467-021-27241-4}
year = {2021}
}
as well as the original DimeNet++ paper.
@inproceedings{klicpera_dimenetpp_2020,
title = {Fast and Uncertainty-Aware Directional Message Passing for Non-Equilibrium Molecules},
author = {Klicpera, Johannes and Giri, Shankari and Margraf, Johannes T. and G{\"u}nnemann, Stephan},
booktitle={NeurIPS-W},
year = {2020}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jax_dimenet-1.0.0.tar.gz
.
File metadata
- Download URL: jax_dimenet-1.0.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11f6c1bb3496a671b72bd3758d3782b78574ba8bacab0926878e32e5c30365a5 |
|
MD5 | f0da2b1f06c59a7519fd7ad947d85eb7 |
|
BLAKE2b-256 | f8d40c64a0cba94ff7cbbd25f60600c97da5aa0fe3317334e0f51ed8b8fb8c41 |
File details
Details for the file jax_dimenet-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: jax_dimenet-1.0.0-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 832bdbf4ff6e26723bedfcf9349e799a2eee0c225e698d431b027b5d2cb481b4 |
|
MD5 | a7241816d71b5318b9ff706554a6ad23 |
|
BLAKE2b-256 | 7effac59d70d0ff795128920f6cfdf24987991918785e299d4c9ae494013a89c |