mdlearn


Namemdlearn JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/ramanathanlab/mdlearn
SummaryMachine learning for molecular dynamics
upload_time2024-08-28 03:37:02
maintainerNone
docs_urlNone
authorAlexander Brace, Heng Ma, Debsindhu Bhowmik, Chakra Chennubhotla, Arvind Ramanathan
requires_python>=3.6
licenseMIT License
keywords machine-learning molecular-dynamics complex-biological-systems
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mdlearn

[![PyPI version](https://badge.fury.io/py/mdlearn.svg)](https://badge.fury.io/py/mdlearn)
[![Documentation Status](https://readthedocs.org/projects/mdlearn/badge/?version=latest)](https://mdlearn.readthedocs.io/en/latest/?badge=latest)

mdlearn is a Python library for analyzing molecular dynamics with machine learning. It contains [PyTorch](https://pytorch.org/) implementations of several deep learning methods such as autoencoders, as well as preprocessing functions which include the [kabsch alignment](https://en.wikipedia.org/wiki/Kabsch_algorithm) algorithm and higher-order statistical methods like [quasi-anharmonic analysis](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0015827).

Currently supported models:
- [Quasi-anharmonic analysis](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.data.preprocess.decorrelation.spatial.html#module-mdlearn.data.preprocess.decorrelation.spatial)
- [Convolutional Variational Autoencoder](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.nn.models.vae.symmetric_conv2d_vae.html#module-mdlearn.nn.models.vae.symmetric_conv2d_vae)
- [Autoencoder](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.nn.models.ae.linear.html#module-mdlearn.nn.models.ae.linear)


For more details and specific examples of how to use mdlearn, please see our [documentation](https://mdlearn.readthedocs.io/en/latest/).

## Table of Contents
1. [Installation](#installation)
2. [Usage](#usage)
3. [Contributing](#contributing)
4. [Acknowledgments](#acknowledgments)
5. [License](#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](https://rapids.ai/) to accelerate t-SNE computations useful for visualizing the model results during training. For the latest [RAPIDS](https://rapids.ai/) version, see [here](https://rapids.ai/start.html#get-rapids). If you don't have GPU support, mdlearn will still work on CPU by using the [scikit-learn](https://scikit-learn.org/stable/) 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](https://pytorch.org/) 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!

```python
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](https://github.com/ramanathanlab/mdlearn/issues).

If you are looking to contribute, please see [`CONTRIBUTING.md`](https://github.com/ramanathanlab/mdlearn/blob/main/CONTRIBUTING.md).


## Acknowledgments

- We thank [Matthias Fey](https://github.com/rusty1s) from [*PyTorch Geometric*](https://github.com/rusty1s/pytorch_geometric) for inspiring the design of our neural network base classes and other [PyTorch](https://pytorch.org/) helper functions.

## License

mdlearn has a MIT license, as seen in the [LICENSE](https://github.com/ramanathanlab/mdlearn/blob/main/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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ramanathanlab/mdlearn",
    "name": "mdlearn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "machine-learning, molecular-dynamics, complex-biological-systems",
    "author": "Alexander Brace, Heng Ma, Debsindhu Bhowmik, Chakra Chennubhotla, Arvind Ramanathan",
    "author_email": "ramanathana@anl.gov",
    "download_url": "https://files.pythonhosted.org/packages/04/0d/e79ec36bd3005bbfa6d5ea2033f78825383ecbf3b7d15afe7829bd088c36/mdlearn-1.0.0.tar.gz",
    "platform": null,
    "description": "# mdlearn\n\n[![PyPI version](https://badge.fury.io/py/mdlearn.svg)](https://badge.fury.io/py/mdlearn)\n[![Documentation Status](https://readthedocs.org/projects/mdlearn/badge/?version=latest)](https://mdlearn.readthedocs.io/en/latest/?badge=latest)\n\nmdlearn is a Python library for analyzing molecular dynamics with machine learning. It contains [PyTorch](https://pytorch.org/) implementations of several deep learning methods such as autoencoders, as well as preprocessing functions which include the [kabsch alignment](https://en.wikipedia.org/wiki/Kabsch_algorithm) algorithm and higher-order statistical methods like [quasi-anharmonic analysis](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0015827).\n\nCurrently supported models:\n- [Quasi-anharmonic analysis](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.data.preprocess.decorrelation.spatial.html#module-mdlearn.data.preprocess.decorrelation.spatial)\n- [Convolutional Variational Autoencoder](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.nn.models.vae.symmetric_conv2d_vae.html#module-mdlearn.nn.models.vae.symmetric_conv2d_vae)\n- [Autoencoder](https://mdlearn.readthedocs.io/en/latest/pages/_autosummary/mdlearn.nn.models.ae.linear.html#module-mdlearn.nn.models.ae.linear)\n\n\nFor more details and specific examples of how to use mdlearn, please see our [documentation](https://mdlearn.readthedocs.io/en/latest/).\n\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Contributing](#contributing)\n4. [Acknowledgments](#acknowledgments)\n5. [License](#license)\n\n## Installation\n\n### Install latest version with PyPI \n\nIf you have access to an NVIDIA GPU, we highly recommend installing mdlearn into a Conda environment which contains [RAPIDS](https://rapids.ai/) to accelerate t-SNE computations useful for visualizing the model results during training. For the latest [RAPIDS](https://rapids.ai/) version, see [here](https://rapids.ai/start.html#get-rapids). If you don't have GPU support, mdlearn will still work on CPU by using the [scikit-learn](https://scikit-learn.org/stable/) implementation.\n\nRun the following commands with updated versions to create a conda environment:\n```\nconda create -p conda-env -c rapidsai -c nvidia -c conda-forge cuml=0.19 python=3.7 cudatoolkit=11.2\nconda activate conda-env\nexport IBM_POWERAI_LICENSE_ACCEPT=yes\npip install -U scikit-learn\n```\n\nThen install mdlearn via: `pip install mdlearn`. \n\nSome systems require [PyTorch](https://pytorch.org/) 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**. \n\n## Usage\n\nTrain an autoencoder model with only a few lines of code!\n\n```python\nfrom mdlearn.nn.models.ae.linear import LinearAETrainer\n\n# Initialize autoencoder model\ntrainer = LinearAETrainer(\n    input_dim=40, latent_dim=3, hidden_neurons=[32, 16, 8], epochs=100\n)\n\n# Train autoencoder on (N, 40) dimensional data\ntrainer.fit(X, output_path=\"./run\")\n\n# Generate latent embeddings in inference mode\nz, loss = trainer.predict(X)\n```\n\n## Contributing\n\nPlease report **bugs**, **enhancement requests**, or **questions** through the [Issue Tracker](https://github.com/ramanathanlab/mdlearn/issues).\n\nIf you are looking to contribute, please see [`CONTRIBUTING.md`](https://github.com/ramanathanlab/mdlearn/blob/main/CONTRIBUTING.md).\n\n\n## Acknowledgments\n\n- We thank [Matthias Fey](https://github.com/rusty1s) from [*PyTorch Geometric*](https://github.com/rusty1s/pytorch_geometric) for inspiring the design of our neural network base classes and other [PyTorch](https://pytorch.org/) helper functions.\n\n## License\n\nmdlearn has a MIT license, as seen in the [LICENSE](https://github.com/ramanathanlab/mdlearn/blob/main/LICENSE) file.\n\n\nMIT License\n\nCopyright (c) 2021 Alexander Brace, Heng Ma, Austin Clyde, Debsindhu Bhowmik, Chakra Chennubhotla, Arvind Ramanathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Machine learning for molecular dynamics",
    "version": "1.0.0",
    "project_urls": {
        "Download": "https://github.com/ramanathanlab/mdlearn/archive/refs/tags/1.0.0.tar.gz",
        "Homepage": "https://github.com/ramanathanlab/mdlearn"
    },
    "split_keywords": [
        "machine-learning",
        " molecular-dynamics",
        " complex-biological-systems"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "040de79ec36bd3005bbfa6d5ea2033f78825383ecbf3b7d15afe7829bd088c36",
                "md5": "113c7f8383580122ffee3a5af429824e",
                "sha256": "d6a8d15d1180f38fbab86ffdee3544aa2b0cddfc5f3c1e49e29744786505c4a2"
            },
            "downloads": -1,
            "filename": "mdlearn-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "113c7f8383580122ffee3a5af429824e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 47397,
            "upload_time": "2024-08-28T03:37:02",
            "upload_time_iso_8601": "2024-08-28T03:37:02.004760Z",
            "url": "https://files.pythonhosted.org/packages/04/0d/e79ec36bd3005bbfa6d5ea2033f78825383ecbf3b7d15afe7829bd088c36/mdlearn-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 03:37:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ramanathanlab",
    "github_project": "mdlearn",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mdlearn"
}
        
Elapsed time: 1.58804s