Skip to content

alec-glisman/DDPM-Enhanced-Sampling

Repository files navigation

DDPMs for Enhanced Sampling of Interfacial Polyelectrolyte Molecular Dynamics Simulations

Project Description: Denoising diffusion probabilistic models (DDPMs) for enhanced sampling of interfacial polyelectrolyte molecular dynamics simulations. The DDPMs are trained on the output of the molecular dynamics simulations to generate new configurations of the system. The new configurations are then used to seed new simulations to explore the phase space with greater efficiency and construct Markov state models (MSMs) to analyze the dynamics of the system. Simulations are performed using the OpenMM molecular dynamics engine.
Authors: Alec Glisman

Sample image of a simulation snapshot

Repository Structure

  • .github: GitHub Actions workflows for continuous integration as well as issue and pull request templates.
  • .vscode: Settings for the Visual Studio Code editor.
  • docs: Documentation source files for Python code in the src directory.
  • images: Images used in the documentation.
  • src: Python source code and unit tests.

Installation

The recommended way to install this project is using conda. To create a conda environment for development, run the following command from the root directory of the repository:

conda create --name ddpm 'python<3.12'
conda activate ddpm
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
conda install pyg -c pyg
conda install py-xgboost-gpu -c conda-forge
conda env update --name ddpm --file requirements.yml

Pytorch should be installed before the rest of the environment to make sure the GPU version is installed. To install the dependencies for the denoising diffusion probabilistic model scripts, run the following command:

git submodule update --init --recursive

cd src/denoising_diffusion_pytorch
git checkout 'polymers-and-wandb'
cd ../..
pip install -e src/denoising_diffusion_pytorch

pip install -e src/mdhelper

Finally, WandB should be installed and set up to track the training of the models:

wandb login

Documentation

The documentation is built using sphinx. For information on how to build the documentation, see the documentation README. Contributions to improve the documentation are welcome. Our current documentation focuses on the signature of each function and class and does not include any tutorials or examples.

Contributing

When contributing to this repository, please first open an issue on GitHub to discuss the change you wish to make. We have provided issue templates for bug reports and feature requests. If you would like to contribute code, please follow the PEP8 style guide. We use flake8 to check for PEP8 compliance and black to format the code. Pre-commit is used to run these checks before each commit as well as to rebuild the documentation using sphinx. We also strongly recommend adding unit tests for any new code using pytest.

Pull Request Process

  1. Create a branch with a descriptive name for the feature or bug fix.
  2. Make your changes and commit them.
  3. Push your changes to the branch.
  4. Open a pull request on GitHub.
  5. The pull request will be reviewed and merged into the main branch if approved and all checks pass.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Diffusion models for enhanced sampling of interfacial polyelectrolyte molecular dynamics simulations.

Topics

Resources

License

Stars

Watchers

Forks

Contributors