An educational PyTorch reimplementation of AlphaFold2, built from the original paper to understand the underlying architecture and geometric deep learning concepts.
Disclaimer: This project is an independent educational implementation and is not affiliated with or endorsed by Google DeepMind.
AlphaFold2-Mini focuses on implementing the core ideas behind AlphaFold2 in a clean and readable codebase rather than reproducing every optimization, training trick, or biochemical lookup table from the original implementation.
The goal is to make the architecture approachable for researchers, students, and machine learning engineers interested in protein structure prediction.
-
Input Embedding
-
Evoformer Stack
- MSA Row Attention
- MSA Column Attention
- Outer Product Mean
- Triangle Multiplication (Incoming & Outgoing)
- Triangle Attention (Starting & Ending Nodes)
- Pair Transition
- MSA Transition
-
Structure Module
- Invariant Point Attention (IPA)
- Structure Transition
- Backbone Update
- Angle ResNet
- Simplified Atom Reconstruction
-
Custom geometric primitives
- Rotation
- Quaternion
- Rigid Transform
- Point / Vector operations
alphafold2-mini/
│
├── alphafold2/
│ ├── modules/
│ ├── chemistry/
│ ├── config.py
│ └── ...
│
├── train.py
├── inference.py
└── README.md
- ✅ Evoformer
- ✅ Invariant Point Attention
- ✅ Structure Transition
- ✅ Backbone Update
- ✅ Angle ResNet
- ✅ Core geometric framework
- Atom reconstruction uses a simplified template system.
- Residue chemistry is intentionally minimal compared to the official implementation.
- Training pipeline
- AlphaFold2 loss functions (FAPE, pLDDT, PAE, violation losses)
- Recycling
- Dataset preprocessing
- Full biochemical residue constants
The official AlphaFold2 implementation contains many engineering components that are essential for state-of-the-art performance but are not necessary to understand the architecture itself.
This project emphasizes:
- readability
- educational value
- modular design
- faithful implementation of the core neural network and geometric algorithms
rather than exact reproduction of every optimization.
- Python 3.10+
- PyTorch
Install dependencies:
pip install torch- Jumper et al. Highly accurate protein structure prediction with AlphaFold. Nature (2021).
- AlphaFold2 Supplementary Information.
- OpenFold.
This repository is intended for educational and research purposes only.
AlphaFold and AlphaFold2 are trademarks and projects of Google DeepMind. This repository is an independent implementation and is not affiliated with Google DeepMind.