Skip to main content

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}
}

Metadata

Release files for jax-dimenet 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jax-dimenet 1.0.0
File Size Uploaded
jax_dimenet-1.0.0.tar.gz 24.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jax-dimenet 1.0.0
File Interpreter ABI Platform
jax_dimenet-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.6 kB

Release files / jax_dimenet-1.0.0.tar.gz

Download URL jax_dimenet-1.0.0.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
11f6c1bb3496a671b72bd3758d3782b78574ba8bacab0926878e32e5c30365a5
BLAKE2b-256 checksum
How to use checksums
f8d40c64a0cba94ff7cbbd25f60600c97da5aa0fe3317334e0f51ed8b8fb8c41
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / jax_dimenet-1.0.0-py3-none-any.whl

Download URL jax_dimenet-1.0.0-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
832bdbf4ff6e26723bedfcf9349e799a2eee0c225e698d431b027b5d2cb481b4
BLAKE2b-256 checksum
How to use checksums
7effac59d70d0ff795128920f6cfdf24987991918785e299d4c9ae494013a89c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page