Coder Social home page Coder Social logo

mileszhao / cubicgan Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 19.63 MB

This is the source code of CubicGAN generating cubic crystal structures using improved WGAN.

Home Page: http://www.carolinamatdb.org/

License: MIT License

Python 100.00%
materials-science deep-learning generative-adversarial-network

cubicgan's Introduction

CubicGAN:

HIGH-THROUGHPUT DISCOVERY OF CUBIC CRYSTAL MATERIALS USING DEEP GENERATIVE NEURAL NETWORKS

Created by Yong Zhao

how to cite

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

@article{zhao2021high,
  title={High-throughput discovery of novel cubic crystal materials using deep generative neural networks},
  author={Zhao, Yong and Al-Fahdi, Mohammed and Hu, Ming and Siriwardane, Edirisuriya MD and Song, Yuqi and Nasiri, Alireza and Hu, Jianjun},
  journal={Advanced Science},
  volume={8},
  number={20},
  pages={2100566},
  year={2021},
  publisher={Wiley Online Library}
}

Introduction

This repository contains the implementation of CubicGAN. You can visit Carolina Materials Database for more info.

Prerequisites

python 3.7
tensorflow-gpu==2.2.0
pymatgen==2020.3.13
numpy==1.16.4
pandas==0.25.1
scikit-learn==0.23.1

we recommend that you build a virtural environment running the code.

How to use the code

Step 1

Once you download the code to your machine, you need to make three folders to the project root directory. The three folders are logs, models, and generated_mat. The folder logs saves training loss of discriminator and generator. The folder models saves trained models. The folder generated_mat saves your generated materials information. We keep 100 cleaned CIFs in folder data/trn-cifs/, you can use them for trying this code. Just calling

python chain.py

can let you experience whole process. If you want to build your own training work, you might need below steps.

Generate materials with a pre-trained model

Under directory pre-trained/, we uploaded the ternary generator model. If you want use the pre-trained model, you can simply change the load model in generate_crystal.py and then you can directly start from Step 4 to generate samples.

Step 2

Before you start to run the code, you have to collect the training data by yourself from open databases (e.g., OQMD). You have to be sure that you convert the downloaded crystal strucutes to symmetrized CIFs and select materials only with atom position of multiplicative factor of 0.25. Then, you can replace the given CIFs in folder data/trn-cifs/ and run

python extract_crystal.py

Note: We recommend that you change the space group ratio in util.py if you want your generated mateirals to follow the similar space group ratio as training data.

Step 3

Train the generator model by runing

python wgan-v2.py

The model will be saved in the folder models.

Step 4

Generate materials by runing

python generate_crystal.py --n_samples=1000

Argument n_samples controls how many materials you will generate and the data will be saved under directory generated_mat/sample-1000.

Step 5

Runing

python pymatgen_valid.py --n_samples=1000

will generate two folders under directory generated_mat/sample-1000. The folder tmp-charge-cifs saves the valid CIFs recognized by pymatgen. The folder tmp-charge-cifs saves the crystal structures with zero charge.

Step 6

For further analysis, run

python build_repeating_cifs_stru.py --n_samples=1000

and

python build_unique_records.py --n_samples=1000

which build a tree structure for repeating CIFs and unique CIFs csv file under directory generated_mat/sample-1000.

Training data used in our work

In file oqmd-dat.csv, we show the IDs and other information of ternary materials in OQMD.

Total Fm-3m F-43m Pm-3m unique formula
375749 186344 184162 5243 249646

License

CubicGAN is released under the MIT License.

cubicgan's People

Stargazers

Jaerin Lee avatar  avatar  avatar zhihao.xu avatar szy_and_c++ avatar Steph-Yves Louis, PhD avatar Sadman Sadeed Omee avatar Sterling G. Baird avatar

Watchers

James Cloos avatar  avatar

cubicgan's Issues

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.