All Projects → txie-93 → Gdynet

txie-93 / Gdynet

Licence: mit
Unsupervised learning of atomic scale dynamics from molecular dynamics.

Projects that are alternatives of or similar to Gdynet

Vde
Variational Autoencoder for Dimensionality Reduction of Time-Series
Stars: ✭ 148 (+300%)
Mutual labels:  jupyter-notebook, molecular-dynamics
Keras deep clustering
How to do Unsupervised Clustering with Keras
Stars: ✭ 202 (+445.95%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Pyiron
pyiron - an integrated development environment (IDE) for computational materials science.
Stars: ✭ 153 (+313.51%)
Mutual labels:  jupyter-notebook, molecular-dynamics
Concrete Autoencoders
Stars: ✭ 68 (+83.78%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Hidt
Official repository for the paper "High-Resolution Daytime Translation Without Domain Labels" (CVPR2020, Oral)
Stars: ✭ 513 (+1286.49%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Openff Toolkit
The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
Stars: ✭ 138 (+272.97%)
Mutual labels:  jupyter-notebook, molecular-dynamics
Dragan
A stable algorithm for GAN training
Stars: ✭ 189 (+410.81%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Sfmlearner
An unsupervised learning framework for depth and ego-motion estimation from monocular videos
Stars: ✭ 1,661 (+4389.19%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Pytorch Cortexnet
PyTorch implementation of the CortexNet predictive model
Stars: ✭ 349 (+843.24%)
Mutual labels:  jupyter-notebook, unsupervised-learning
100 Days Of Ml Code
100-Days-Of-ML-Code中文版
Stars: ✭ 16,797 (+45297.3%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Weakly Supervised 3d Object Detection
Weakly Supervised 3D Object Detection from Point Clouds (VS3D), ACM MM 2020
Stars: ✭ 61 (+64.86%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Pydhamed
Dynamic Histogram Analysis To Determine Free Energies and Rates from Biased Simulations
Stars: ✭ 17 (-54.05%)
Mutual labels:  jupyter-notebook, molecular-dynamics
Simclr
SimCLRv2 - Big Self-Supervised Models are Strong Semi-Supervised Learners
Stars: ✭ 2,720 (+7251.35%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Pytorch Byol
PyTorch implementation of Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning
Stars: ✭ 213 (+475.68%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Simclr
PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations
Stars: ✭ 750 (+1927.03%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Discogan Pytorch
PyTorch implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"
Stars: ✭ 961 (+2497.3%)
Mutual labels:  jupyter-notebook, unsupervised-learning
Renewable power plants
Data package: renewable power plants
Stars: ✭ 36 (-2.7%)
Mutual labels:  jupyter-notebook
Face Mask Detection
Face masks are crucial in minimizing the propagation of Covid-19, and are highly recommended or even obligatory in many situations. In this project, we develop a pipeline to detect unmasked faces in images. This can, for example, be used to alert people that do not wear a mask when entering a building.
Stars: ✭ 37 (+0%)
Mutual labels:  jupyter-notebook
Analyticstool
함수산책 - 캐글뽀개기 스터디 자료 보관소
Stars: ✭ 36 (-2.7%)
Mutual labels:  jupyter-notebook
Cs145 Notebooks 2016
Public materials for the Fall 2016 offering of CS145
Stars: ✭ 36 (-2.7%)
Mutual labels:  jupyter-notebook

Graph Dynamical Networks

This software package implements the Graph Dynamical Networks (GDyNet) that automatically learns atomic scale dynamics for materials from molecular dynamics trajectories.

The following paper describes the details of the the method.

Graph Dynamical Networks for Unsupervised Learning of Atomic Scale Dynamics in Materials

Table of Contents

How to cite

Please cite the following work if you want to use GDyNet.

@article{xie_graph_2019,
	title = {Graph dynamical networks for unsupervised learning of atomic scale dynamics in materials},
	volume = {10},
	issn = {2041-1723},
	url = {http://www.nature.com/articles/s41467-019-10663-6},
	doi = {10.1038/s41467-019-10663-6},
	language = {en},
	number = {1},
	urldate = {2019-06-19},
	journal = {Nature Communications},
	author = {Xie, Tian and France-Lanord, Arthur and Wang, Yanming and Shao-Horn, Yang and Grossman, Jeffrey C.},
	month = dec,
	year = {2019},
	pages = {2667}
}

Prerequisites

This package requires:

If you are new to Python, the easiest way of installing the prerequisites is via conda. After installing conda, run the following command to create a new environment named gdynet and install all prerequisites:

conda upgrade conda
conda create -n gdynet python=3.6 tensorflow pymatgen tqdm -c anaconda -c conda-forge

This creates a conda environment for running GDyNet. Before using GDyNet, activate the environment by:

source activate gdynet

Then, in directory gdynet, you can test if all the prerequisites are installed properly by running:

python main.py -h
python preprocess.py -h

This should display the help messages for main.py and preprocess.py. If you find no error messages, it means that the prerequisites are installed properly.

After you finished using GDyNet, exit the environment by:

source deactivate

Usage

Preprocess MD data

The GdyNets use dynamically constructed graphs to represent the atomic structures of materials in the MD trajectories. Unfortunately, we can't construct the graphs during the neural network training process because the graph construction algorithm is slow. So, we provide a preprocess.py to construct graphs from the MD trajectories as a preprocessing step.

First, you need to prepare your MD trajectories into a traj.npz file using numpy.savez_compressed. It has a dictionary-like data structure which can be queried for its list of arrays with fast IO. For a MD trajectory containing N atoms and F frames, the traj.npz file contains,

  • traj_coords: np.float arrays with shape (F, N, 3), stores the cartesian coordinates of each atom in each frame.
  • lattices: np.float arrays with shape (F, 3, 3), stores the lattice matrix of the simulation box in each frame. In the lattice matrix, each row represents a lattice vector.
  • atom_types: np.int arrays with shape (N,), stores the atomic number of each atom in the MD simulation.
  • target_index: np.int arrays with shape (n,), stores the indexes (0-based) of the target atoms (n <= N). Note that here we assume the target atoms are just single atoms (like Li-ions) and each index repesents one target atom. We will support cases where target atoms are molecules (like water molecules) in the futhre.

Then, you can use the preprocess.py to preprocess the traj.npz. It will create a graph.npz file that contains the dynamically constructed graphs.

python preprocess.py traj.npz graph.npz

Note that the graph construction is slow especially for large MD trajectories. There two different graph construction algorithms implemented. The default --backend kdtree has a linear scaling but only works for orthogonal simulation box. For non-orthogonal simulation, use flag --backend direct which has a quadratic scaling. You can also take advantage of the multiprocessing with flag --n-workers. For other flags, checkout the help information with python preprocess.py -h.

Training the model

Before training the model, you should split your MD trajectory into three parts for training, validation, and testing. Then, following the steps in preprocess MD data, you can construct graphs for these three trajectories and obtain train-graph.npz, val-graph.npz, and test-graph.npz.

Now, you can start to train a GDyNet model. To keep everything clean, we create a new folder training to store all the intermediate files.

mkdir training

Then, you can use the main.py to train your model.

python main.py --train-flist train-graph.npz --val-flist val-graph.npz --test-flist test-graph.npz --job-dir training/

There are several common issues that may prevent the training from success.

  • If the loss becomes NaN, it usually means the learning rate is too high. Try decrease it with flag --lr.
  • If there is GPU memory error, you may want to decrease the batch size with flag -b.
  • Make sure that the --mode matches the graph construction algorithm.
  • You can also try different --n-classes, --tau, --atom-fea-len, and --n-conv to get the best performance. For other flags, use python main.py -h for helps.

Visualize the results

After the training, you can visualize the dynamical model using the functions in the postprocess module. We provide a jupyter notebook to demonstrate how to visualize the results for the toy system from the paper.

Data

To reproduce our results or use the data from our paper, see these instructions.

Authors

This software was primarily written by Tian Xie who was advised by Prof. Jeffrey Grossman.

The VAMP loss module is modified on top of the VAMPnet project by A. Mardt, et al. The PeriodicKDTree module is modifed on top of the periodic_kdtree project by P. Varilly.

License

Graph Dynamical Networks is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].