MolGAN (Molecular Generative Adversarial Network), a deep learning model designed to create new, chemically valid molecular structures.
- Using pure RL (lamda = 0)
- Half wgan and RL (lambda = 0.5)
- Pure wgan (lambda = 1)
The architecture consists of 3 main sections: a generator, a discriminator, and a reward network.
The generator takes a sample (z) from a standard normal distribution to generate a graph using an MLP (this limits the network to a fixed maximum size) to generate the graph at once. Specifically a dense adjacency tensor A (bond types) and an annotation matrix X (atom types) are produced. Since these are probabilities, a discrete, sparse x and a are generated through categorical sampling.
The discriminator and reward network have the same architectures and receive graphs as inputs. A Relational-GCN and MLPs are used to produce the singular output
-
Clone the Repository
Clone the MolGAN implementation repository to your local machine:git clone https://github.com/kfzyqin/Implementation-MolGAN-PyTorch.git cd Implementation-MolGAN-PyTorch -
Download Molecular Metrics Models
Run the provided script to download pre-trained models for evaluating molecular metrics (e.g., validity, uniqueness, novelty):sh download_dataset.sh
This script downloads necessary utilities defined in
utils.py. -
Generate the Dataset
Process the QM9 dataset to create a sparse molecular dataset compatible with MolGAN:python sparse_molecular_dataset.py
Note: Uncomment the last few lines in
sparse_molecular_dataset.pyto enable dataset generation. -
Train the Model
Execute the training script to start training MolGAN:python train.py
- Hyperparameters (e.g., learning rate, batch size, λ) can be adjusted in the
train.pyorSolvemodule for experimentation. - Monitor training progress through loss metrics and generated molecule quality.
- Hyperparameters (e.g., learning rate, batch size, λ) can be adjusted in the