MoFlow
An invertible flow model that maps molecular graphs to latent vectors and back, with separate bond and atom flows.
Molecules, proteins and genomics · 1,726 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 2.7M
- Operations
- 1,726
- Framework
- PyTorch
- Recurrent
- No
- Published
- KDD 2020
- Cited by
- 272 (as of 29 October 2026)
- Authors
- Chengxi Zang, Fei Wang
- Source
- GitHub: calvin-zcx/moflow
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m18483
- Graph hash
- 53282352ce4cdc9e34e03143994933cc47046f5a0c2ed8023003576ca9461247
- Skeleton hash
- c8b76ffa4d58e7cc34f933bf2f25e360876e3a9f51e979b1eb591ffd1c5372f8
- Architecture hash
- aa00f1a079d19019c781a0f26ced58ae8fe44c4c9ddfd20a398b26c6a85898d6
- Diagram SHA-256
- 98a7e68f25504f2398095f94005c73e9db847ad14d477d0d05708ba18382608b
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
MoFlow is a flow-based generative model for molecular graphs: it learns invertible mappings between a molecule and its latent representation, so one network both embeds molecules and, run in reverse, generates them. The paper presents this as a route to drug discovery, where the hard part is producing molecules that are both novel and chemically valid.
The model is made of two flows, a variant of Glow for the bonds and a graph conditional flow for the atoms given the bonds. The bond flow applies affine coupling layers together with the invertible 1 × 1 convolution and actnorm layers of Glow. In the atom flow, each coupling layer is built from relational graph convolutions (R-GCN) over the bond graph. Both flows use a Sigmoid as the scale function where an exponential is the common choice, which the authors adopted for numerical stability when stacking many layers.
After generation, atoms and bonds are assembled into a molecule that satisfies bond-valence constraints by a post-hoc validity correction. This model has the QM9 configuration, for which the paper adopts 10 coupling layers in the bond flow and 27 graph coupling layers in the atom flow. The paper reports a 100% reconstruction rate for MoFlow.
Key idea. MoFlow generates molecular graphs with an invertible flow: a Glow-based model for bonds, a graph conditional flow for atoms given bonds, and a post-hoc validity correction.
- MoFlow
- molecular graph generation
- normalizing flow
- flow-based generative model
- graph conditional flow
- de novo drug design
- molecule generation
- invertible model
- QM9
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{zang2020moflowinvertibleflowmodel,
title={MoFlow: An Invertible Flow Model for Generating Molecular Graphs},
author={Chengxi Zang and Fei Wang},
year={2020},
eprint={2006.10137},
archivePrefix={arXiv},
primaryClass={stat.ML},
doi={https://doi.org/10.1145/3394486.3403104},
url={https://arxiv.org/abs/2006.10137},
}