Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aksub99/moldqn-pytorch
A PyTorch Implementation of "Optimization of Molecules via Deep Reinforcement Learning".
https://github.com/aksub99/moldqn-pytorch
chemistry deep-learning dqn-pytorch drug-discovery inverse-design machine-learning materials-informatics materials-science molecule python pytorch pytorch-implementation pytorch-rl reinforcement-learning
Last synced: 2 months ago
JSON representation
A PyTorch Implementation of "Optimization of Molecules via Deep Reinforcement Learning".
- Host: GitHub
- URL: https://github.com/aksub99/moldqn-pytorch
- Owner: aksub99
- License: mit
- Created: 2019-10-19T20:09:32.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T23:37:44.000Z (over 1 year ago)
- Last Synced: 2024-09-26T08:41:16.534Z (3 months ago)
- Topics: chemistry, deep-learning, dqn-pytorch, drug-discovery, inverse-design, machine-learning, materials-informatics, materials-science, molecule, python, pytorch, pytorch-implementation, pytorch-rl, reinforcement-learning
- Language: Python
- Size: 3.05 MB
- Stars: 74
- Watchers: 3
- Forks: 28
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MolDQN-pytorch
[![MIT
license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)PyTorch implementation of MolDQN as described in [Optimization of Molecules via Deep Reinforcement Learning](https://www.nature.com/articles/s41598-019-47148-x)
by Zhenpeng Zhou, Steven Kearnes, Li Li, Richard N. Zare and Patrick Riley.## Installation
1) Install `rdkit`.
`conda create -c rdkit -n my-rdkit-env rdkit`
`conda activate my-rdkit-env`
`conda install -c conda-forge rdkit`
2) Clone this repository.
`git clone https://github.com/aksub99/MolDQN-pytorch.git`
`cd MolDQN-pytorch`
3) Install the requirements given in `requirements.txt`.
`pip install -r requirements.txt`
4) Install `baselines`.
`pip install "git+https://github.com/openai/baselines.git"`
## From Docker:Using a docker image requires an NVIDIA GPU. If you do not have a GPU please follow the directions for [installing from source](#source)
In order to get GPU support you will have to use the [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) plugin.
``` bash
# Build the Dockerfile in Dockerfiles/Dockerfile to create a Docker image.
cd Dockerfiles
docker build -t moldqn_pytorch:latest .# This will create a container from the image we just created.
nvidia-docker run -[Options] moldqn_pytorch:latest python path/to/main.py
```
Please remember to modify the `TB_LOG_PATH` variable in `main.py` depending on where you wish to store your tensorboard runs file.
## Training the MolDQN:`python main.py`
A simple example to train the model on a single property optimization task can be seen in `examples/MolDQN-pytorch.ipynb`.
## Results:
The following was the reward curve obtained when the model was trained for 5000 episodes on a single property optimization task (QED in this case).
## References:
The original tensorflow implementation can be found at https://github.com/google-research/google-research/tree/master/mol_dqn
This repository re-uses some code from the original implementation.