Generating molecules with MolGAN
Deep graph generation is not well covered by PyTorch Geometric. Drug discovery is the main application of this subfield, which is why generative models can be found in specialized libraries. More specifically, there are two popular Python libraries for ML-based drug discovery: DeepChem
and torchdrug
. In this section, we will use DeepChem as it is more mature and directly implements MolGAN.
Let’s see how we can use it with DeepChem
and tensorflow
. The following procedure is based on DeepChem’s example:
- We install
DeepChem
(https://deepchem.io), which requires the following libraries:tensorflow
,joblib
,NumPy
,pandas
,scikit-learn
,SciPy
, andrdkit
:!pip install deepchem==2.7.1
- Then, we import the required packages:
import numpy as np import tensorflow as tf import pandas as pd from tensorflow import one_hot import deepchem as dc from deepchem.models.optimizers import ExponentialDecay from deepchem.models import BasicMolGANModel...