Skip to main content

Pro Generative Tensorial Reinforcement Learning (proGENTRL): Leverage the power using pytorch Lightning and generate molecules

Project description

Pro Generative Tensorial Reinforcement Learning (proGENTRL)

This is a Pytorch Lightning implementation of GENTRL. Recently Pytorch Lightning has gained much popularity due to its lightweight framework and flexibility with handling multiple devices from a single GPU to a HPC cluster. So in order to maximize the efficiency of using GENTRL on multi-GPU environment I have implemented this pytorch lightning code.

What is GENTRL?

The GENTRL model is a variational autoencoder with a rich prior distribution of the latent space. We used tensor decompositions to encode the relations between molecular structures and their properties and to learn on data with missing values. We train the model in two steps. First, we learn a mapping of a chemical space on the latent manifold by maximizing the evidence lower bound. We then freeze all the parameters except for the learnable prior and explore the chemical space to find molecules with a high reward.

GENTRL

Installation

Step 1 :

Make a new conda environment and install RDKit.

conda create -c rdkit -n my-rdkit-env rdkit

Then activate this new environment.

conda activate my-rdkit-env

Note : Make sure that the python3 version is 3.5 or higher and pip3 is installed

Step 2 :

Inside this environment install proGENTRL.

Using pip (Recommended)

pip install progentrl

Using source

git clone https://github.com/Bibyutatsu/proGENTRL.git
cd proGENTRL
python3 setup.py install

Step 3 :

Then I will suggest you install pytorch's latest version according to your cuda version (For e.g. 10.2)

python3 -m pip uninstall torch torchvision
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

Step 4 : (Optional)

Making a new Kernel for jupyter notebook is recommended. For making a new kernel please follow these steps.

python3 -m pip install ipykernel
python3 -m ipykernel install --user --name rdkit_kernel

Now when you open jupyter notebook. Go to Change Kernel > rdkit_kernel

With these the installation is over and now we are ready to run the Example.ipynb notebook provided in the Repo.

Example.ipynb

This notebook is a good starting point to look at how proGENTRL works. It incorporates all the steps from VAE Training to Reinforcement Learning and finally Sampling or generation of new molecules in the form of SMILES strings.

The basic flow of the model is: VAE Train :arrow_right: Reinforcement Learning :arrow_right: Sampling

Below we show examples of generated molecules (more samples here). You can find more explanations in my originarlly forked Repo of GENTRL please visit here

Sampling

For reading more visit my blog

Supporting Information for the paper "Deep learning enables rapid identification of potent DDR1 kinase inhibitors". Original Repo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

progentrl-1.0.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

progentrl-1.0.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file progentrl-1.0.0.tar.gz.

File metadata

  • Download URL: progentrl-1.0.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for progentrl-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d90429fa11e2a42759a80dfeac6a06c54938a2dd1045991804e91c4c431da7ca
MD5 8113ae20a9e625a48b2e0e75457308b2
BLAKE2b-256 0f52d93e47a8d40a3c6914741bbc454d4de8e3437fdc894d145c1530f8eb0530

See more details on using hashes here.

File details

Details for the file progentrl-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: progentrl-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for progentrl-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 48d4b18d644afa160c1d15e99dca64ae284d01196f5c59f1f985f61662ee86f8
MD5 854e930ae80dca7325ca511d89869251
BLAKE2b-256 eab32f4bfc61ac0b8c74dc258df98dc89bdd1018565ef20d9b3a6b92dc712f3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page