Skip to main content

Machine learning for molecular dynamics

Project description

mdlearn

PyPI version Documentation Status

mdlearn is a Python library for analyzing molecular dynamics with machine learning. It contains PyTorch implementations of several deep learning methods such as autoencoders, as well as preprocessing functions which include the kabsch alignment algorithm and higher-order statistical methods like quasi-anharmonic analysis.

Currently supported models:

For more details and specific examples of how to use mdlearn, please see our documentation.

Table of Contents

  1. Installation
  2. Usage
  3. Contributing
  4. Acknowledgments
  5. License

Installation

Install latest version with PyPI

If you have access to an NVIDIA GPU, we highly recommend installing mdlearn into a Conda environment which contains RAPIDS to accelerate t-SNE computations useful for visualizing the model results during training. For the latest RAPIDS version, see here. If you don't have GPU support, mdlearn will still work on CPU by using the scikit-learn implementation.

Run the following commands with updated versions to create a conda environment:

conda create -p conda-env -c rapidsai -c nvidia -c conda-forge cuml=0.19 python=3.7 cudatoolkit=11.2
conda activate conda-env
export IBM_POWERAI_LICENSE_ACCEPT=yes
pip install -U scikit-learn

Then install mdlearn via: pip install mdlearn.

Some systems require PyTorch to be built from source instead of installed via PyPI or Conda, for this reason we made torch an optional dependency. However, it can be installed with mdlearn by running pip install 'mdlearn[torch]' for convenience. Installing this way will also install the wandb package. Please check that torch version >= 1.7.

Usage

Train an autoencoder model with only a few lines of code!

from mdlearn.nn.models.ae.linear import LinearAETrainer

# Initialize autoencoder model
trainer = LinearAETrainer(
    input_dim=40, latent_dim=3, hidden_neurons=[32, 16, 8], epochs=100
)

# Train autoencoder on (N, 40) dimensional data
trainer.fit(X, output_path="./run")

# Generate latent embeddings in inference mode
z, loss = trainer.predict(X)

Contributing

Please report bugs, enhancement requests, or questions through the Issue Tracker.

If you are looking to contribute, please see CONTRIBUTING.md.

Acknowledgments

License

mdlearn has a MIT license, as seen in the LICENSE file.

MIT License

Copyright (c) 2021 Alexander Brace, Heng Ma, Austin Clyde, Debsindhu Bhowmik, Chakra Chennubhotla, Arvind Ramanathan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

mdlearn-1.0.1.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

mdlearn-1.0.1-py3-none-any.whl (79.4 kB view details)

Uploaded Python 3

File details

Details for the file mdlearn-1.0.1.tar.gz.

File metadata

  • Download URL: mdlearn-1.0.1.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for mdlearn-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a703c885d897c39b4763b481437c7515bddde2bf72507f47227a38afe264bf23
MD5 3df74f931f8a7c14b3ea4cf0da7f07c2
BLAKE2b-256 51ad6fc02c6b73b8fa967e7932470d43749bfcbd8e2328a0805b52a6fae06a48

See more details on using hashes here.

File details

Details for the file mdlearn-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: mdlearn-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 79.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for mdlearn-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3887c290f538c30424ec174ce58262d9b0623182b41f1bee58d1a6a17d47e499
MD5 0a33215b09572f005f32f42c46c136a7
BLAKE2b-256 8b49d6cf840b868dfc2c773473948b3a31908f25b5dc218f82707cb06c27b58c

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