GithubHelp home page GithubHelp logo

prokia / reinvent-gdb13 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from undeadpixel/reinvent-gdb13

0.0 1.0 0.0 30.91 MB

A Recurrent Neural Network implementation that uses SMILES strings to generate molecules from GDB-13

License: MIT License

Python 100.00%

reinvent-gdb13's Introduction

Implementation of the RNN model used in "Exploring the GDB-13 chemical space using deep generative models"

NOTE: This repository has been archived because a newer one has been created with additional features. The code here is left only to complement the previously published article.

Please have a look at undeadpixel/reinvent-randomized for the improved software.

This code allows to create, train and sample RNN with the architecture described in:

Exploring the GDB-13 Chemical Space Using Deep Generative Models

Also find an already trained model with a 1M random sample of GDB-13 in the trained_models folder.

Install

A Conda environment.yml is supplied with all the required libraries.

$> conda env create -f environment.yml
$> source activate reinvent-gdb13
(reinvent-gdb13) $> ./create_model.py -h
usage: create_model.py [-h] --input-smiles-path INPUT_SMILES_PATH
                       --output-model-path OUTPUT_MODEL_PATH
                       [--num-gru-layers NUM_GRU_LAYERS]
                       [--gru-layer-size GRU_LAYER_SIZE]
                       [--embedding-layer-size EMBEDDING_LAYER_SIZE]

Create a model with the vocabulary extracted from a SMILES file.

optional arguments:
  -h, --help            show this help message and exit
  --input-smiles-path INPUT_SMILES_PATH, -i INPUT_SMILES_PATH
                        SMILES to calculate the vocabulary from. The SMILES
                        are taken as-is, no processing is done.
  --output-model-path OUTPUT_MODEL_PATH, -o OUTPUT_MODEL_PATH
                        Prefix to the output model.
  --num-gru-layers NUM_GRU_LAYERS, -n NUM_GRU_LAYERS
                        Number of GRU layers of the model [DEFAULT: 3]
  --gru-layer-size GRU_LAYER_SIZE, -s GRU_LAYER_SIZE
                        Size of each of the GRU layers [DEFAULT: 512]
  --embedding-layer-size EMBEDDING_LAYER_SIZE, -e EMBEDDING_LAYER_SIZE
                        Size of the embedding layer [DEFAULT: 256]

General Usage

Three tools are supplied. By default the parameters are set to match those used in the publication. To get further information about the tool, please run the help implemented in each of them, or look at the examples below.

  1. Create Model (create_model.py): Creates a blank model file.
  2. Train Model (train_model.py): Trains the model with the specified parameters.
  3. Sample Model (sample_from_model.py): Samples an already trained model for a given number of SMILES. It can also retrieve the log-likelihood in the process.

Usage example

Create, train and sample a network as in the publication.

(reinvent-gdb13) $> mkdir gdb13_models
(reinvent-gdb13) $> ./create_model.py -i training_set.smi -o gdb13.1M.model.empty
(reinvent-gdb13) $> ./train_model.py -i gdb.13.1M.model.empty -o gdb13_models/model -s training_set.smi --num-epochs=200 --lrcs=0.9772 --save-every-n-epochs=1
# (... wait 24-48h ...)
(reinvent-gdb13) $> ./sample_from_model.py gdb13_models/model.70 -n 1000000 --with-likelihood -o sample.smi

reinvent-gdb13's People

Contributors

undeadpixel avatar

Watchers

James Cloos 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.