mdlearn
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
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)
Preprocessing
We provide a CLI for collecting common data products from simulations. Currently, we support the following preprocessing methods:
- Coordinates
- Contact maps
- Root mean square deviation (RMSD)
Run the following command for details on how to use the CLI:
mdlearn preprocess --help
Contributing
Please report bugs, enhancement requests, or questions through the Issue Tracker.
If you are looking to contribute, please see CONTRIBUTING.md.
Acknowledgments
- We thank Matthias Fey from PyTorch Geometric for inspiring the design of our neural network base classes and other PyTorch helper functions.
License
mdlearn has a MIT license, as seen in the LICENSE file.
Metadata
Release files for mdlearn 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdlearn-1.0.5.tar.gz | 211.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdlearn-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 295.2 kB
Release files / mdlearn-1.0.5.tar.gz
| Download URL | mdlearn-1.0.5.tar.gz |
|---|---|
| Size | 211.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3bc7fc577b47249f00c6eafe36d7d1bb19e3c7d35ab38eb99b73e52f1c623b9
|
|
BLAKE2b-256 checksum How to use checksums |
10e38a7249d19633042cfd7546a3dd90c998af3988a54374924ea158fc7cdb81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / mdlearn-1.0.5-py3-none-any.whl
| Download URL | mdlearn-1.0.5-py3-none-any.whl |
|---|---|
| Size | 83.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01424f22cec9ca982f9ce16ed855d7203e379eaeb8026ca7b5c039f56e7f565b
|
|
BLAKE2b-256 checksum How to use checksums |
526fae2b53ed58e2aea6623302ccb3f7617573bcc31ab0d6dedde701ec24cd9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|