Coder Social home page Coder Social logo

owaisahmad18 / rnn-md Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softmaterialslab/rnn-md

0.0 0.0 0.0 56.69 MB

Code for our paper "Simulating Molecular Dynamics with Large Timesteps using Recurrent Neural Networks"

License: Apache License 2.0

C++ 0.06% Python 0.50% TeX 0.29% Makefile 0.01% CMake 0.01% Jupyter Notebook 99.14%

rnn-md's Introduction

Simulating Molecular Dynamics with Large Timesteps using Recurrent Neural Networks

JCS Kadupitiya, Geoffrey C. Fox, Vikram Jadhao | 2020

  • Molecular dynamics simulations rely on numerical integrators such as Verlet to solve the Newton's equations of motion. Using a sufficiently small timestep to avoid discretization errors, Verlet integrators generate a trajectory of particle positions as solutions to the equations of motions. We introduce an integrator based on recurrent neural networks that is trained on trajectories generated using Verlet integrator and learns to propagate the dynamics of particles with timestep up to 4000 times larger compared to the Verlet timestep. We demonstrate significant net speedup of up to 32000 for few-particle (1 - 16) 3D systems and over a variety of force fields.

  • Paper: https://arxiv.org/abs/2004.06493

  • Cite as:

@misc{kadupitiya2020simulating,
    title={Simulating Molecular Dynamics with Large Timesteps using Recurrent Neural Networks},
    author={JCS Kadupitiya and Geoffrey C. Fox and Vikram Jadhao},
    year={2020},
    eprint={2004.06493},
    archivePrefix={arXiv},
    primaryClass={physics.comp-ph}
}

Directory Structure

.
├── data                 # All the datafiles for experiments are here, read the readme inside
├── figures              # Main fugures are here
├── models               # Pretrained LSTM models are here
├── paper                # latex files for the paper
├── scripts              # Supporting python scripts for MD-visualization
└── src                  # Codes needed to run RNN-MD
    ├── config           # All the configurations for RNN models are in YAML files
    ├── md-codes         # MD codes in python and c++
    ├── model            # Main codebase for RNN-MD
    ├── paper-figures    # Python notebooks used to generate the figures for the paper
    ├── spec.._local     # Python notebook version of the RNN-MD 
    ├── spec.._colab     # google colab notebook version of the RNN-MD 
    ├── temp_data        # temporary data folders for visualization
    ├── DW-Ex..ipynb     # Double well experiment
    ├── LJ-Ex..ipynb     # Lennord Jones experiment
    ├── Ru.-Ex..ipynb    # Rugged potential experiment
    ├── SHO-Ex..ipynb    # SHO experiment        
    ├── Ma.-Ex..ipynb    # Many particle PB experiment 
  • Note: We encourage the use of notebooks at source level (src) compared to the notebooks at src/spec...
    • This is because the notebooks at the src level demonstrate how to use the model with src/model code which uses one code base for all the experiments with different configuration files (src/config).
    • On the other hand, the notebooks which are at src/spec.., are standalone notebook versions of src/model.
    • The following example explains the use of ource level (src) notebooks as it is much easier to understand.

Example Model Training and Testing

  • First, git clone the project: git clone https://github.com/softmaterialslab/RNN-MD.git
  • Next, go to src directory and run the following in a python 3 environment.
  • If you want to change any configuration, please edit the src/config/SHO.yaml file.
  • Then, load the module and load configuration from SHO.yaml file.
from model.RNN_MD import RNN_MD
rnn_md = RNN_MD(experiment='sho')
  • Next, load dataset: rnn_md.load_data()
  • Then, train and save the model:
rnn_md.train()
rnn_md.save_model()
  • Similary, if you have a pretrained model in model directory, load it as follows: rnn_md.load_model()
  • Then use the model to run a RNN-MD simulation:
import matplotlib.pyplot as plt
%matplotlib inline

rnn_md.simulate_new(testing_index=1)

fig=plt.figure(figsize=(16, 6))
plt.title(rnn_md.input_list[rnn_md.sim_])
plt.plot(rnn_md.actual_output,'r+', label='MD_dynamics', linewidth=1, markersize=3, linestyle='dashed')
plt.plot(rnn_md.predicted_output, label='MD-RNN')
plt.plot(rnn_md.Only_RNN_predicted_output, label='continous RNN')
plt.legend()
  • All the experiments canbe run using similar setup, please check notebooks available in src directory.

Example results for 16 particle periodic boundry simulation

  • Example simulations with LJ potentail, 16 particle in a periodic boundary simulation:

16-LJ-PB


  • Example simulations with LJ potentail, 16 particle in a spherical hard wall simulation:

16-LJ-SP


Architecture Figures

  • Overview of the deep learning approach:

overall-idea

  • RNN-MD architecture:

rnn-md's People

Contributors

kadupitiya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.