How miloszgrabski/deepchem_molgan works
Project Type & Purpose
• This is an open‐source DeepChem extension implementing the MolGAN paper (graph‐based molecular generative adversarial network).
• It provides a featurizer, custom graph layers, and a MolGAN model, intended to be merged into DeepChem as of v2.5.
File Structure
Top‐level modules:
• data/ – raw QM9 dataset (.csv)
• feat/ – MolGANFeaturizer (converts molecules to graph tensors)
• layers/ – custom graph neural network layers (generator, discriminator components)
• models/ – MolGAN architecture (wiring of generator, discriminator, reward net)
• main.ipynb & tutorial.ipynb – demonstration notebooks
Other files: packaging (__init__.py), config (.gitignore, .gitattributes), metadata (LICENSE, README).
Gather Insights from README
• Implements “MolGAN” in DeepChem 2.4, migrating code directly into DeepChem’s repository.
• No external services—pure library code to be called from Python or notebooks.
Main Components & Their Interactions
• Data Ingestion
• Source: data/QM9_HAC_5_9_.csv
• Responsible for loading raw molecular data.
• Featurization
• feat/molgan_featurizer.py
• Transforms SMILES (or molecule objects) → graph adjacency & feature tensors.
• Custom Layers
• layers/layers.py
• Implements graph conv, noise‐to‐graph (generator), graph‐to‐scalar (discriminator, reward network).
• MolGAN Model
• models/molgan.py
• Assembles generator, discriminator, reward network; defines loss, training loop hooks.
• Execution / Orchestration
• main.ipynb / tutorial.ipynb
• Example pipelines: load data → featurize → instantiate MolGAN → train → sample new molecules.
• External Dependencies
• DeepChem core (v2.4+), RDKit (chemistry utilities), TensorFlow or PyTorch backend.
Architectural Patterns & Principles
• Modular layering: clear separation between data handling, featurization, network layers, high‐level model.
• Extensibility point: new featurizers or layers can be dropped into feat/ or layers/ without altering core model.
• Leverages DeepChem’s Trainer API for standard training loops.