Code Monkey home page Code Monkey logo

crystal-design's Introduction

Offline Reinforcement Learning for Crystal Design

Introduction

In this work, we adopt conservative Q-learning, a popular offline reinforcement learning approach to learning a conditional policy that can design new and stable crystals having the desired band gap. Our targeted formulation of the reward function for offline RL is crafted from formation energy (per atom) and band gap values computed using first-principles DFT calculations, widely used in computational chemistry. Refer to our paper for more details about our methodology.

alt text

Documentation

Installation

To install, clone the repository

git clone https://github.com/chandar-lab/crystal-design.git
cd crystal-design
pip install -r requirements.txt
pip install -e .
cd crystal_design

If dgl installation fails, please refer https://www.dgl.ai/pages/start.html.

Training

We use the crystal_cql.py in the runner folder for training and generation. Use this command for the list of arguments.

python crystal_cql.py -h

To train a conditional CQL model from scratch for 250000 steps, execute

python crystal_cql.py --data_path <path to trajectory data> --p_hat <target property> --max_timesteps 250000

To train an unconditional CQL model for 250000 steps, execute

python crystal_cql.py --data_path <path to trajectory data> --max_timesteps 250000 --nocondition True

To train a behavioral cloning model for 250000 steps, execute

python crystal_cql.py --data_path <path to trajectory data> --max_timesteps 250000 --bc True --nocondition True

Generating Crystals

To generate crystal using a learned model, whose checkpoint (.pt) is stored in a directory, follow the command

python crystal_cql.py --mode eval --model_path <path to checkpoint> --p_hat <target property>

A recommended way to do the same is to directly provide the path to the wandb run, in which case it will run the checkpoint file named checkpoint_250000.pt (this can be modified)

python crystal_cql.py --mode eval --eval_wandb_path <path to wandb run> --no_condition <True/False>

crystal-design's People

Contributors

gprashant17 avatar jarridrb avatar

Stargazers

 avatar

Watchers

Sarath Chandar avatar  avatar Kostas Georgiou avatar

crystal-design's Issues

to_cif failed

Hello, thank you for the data and code you provided. I am trying to reproduce your project, but it fails due to dimension problem when i execute evaluation. I want to know if there is a bug in the to_cif function that prevents the cif file from being generated. Thank you very much.

Generate Trajectory Failed

Hello, thank you for the data and code you provided. I am trying to reproduce your project, but it fails due to unknown reasons when generating trajectories. Can you provide the files in the trajectories directory? Thank you very much.

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.