JeffKatzy/alphafold2-mini

An Exploratory Implementation of the AlphaFold2 protein folding transformer neural network.

★ 0Forks 0GitHub ↗Compare

README

AlphaFold2-Mini

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.


Overview

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.


Features

  • 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

Project Structure

alphafold2-mini/
│
├── alphafold2/
│   ├── modules/
│   ├── chemistry/
│   ├── config.py
│   └── ...
│
├── train.py
├── inference.py
└── README.md

Current Status

Implemented

  • ✅ Evoformer
  • ✅ Invariant Point Attention
  • ✅ Structure Transition
  • ✅ Backbone Update
  • ✅ Angle ResNet
  • ✅ Core geometric framework

Simplified

  • Atom reconstruction uses a simplified template system.
  • Residue chemistry is intentionally minimal compared to the official implementation.

Not Included

  • Training pipeline
  • AlphaFold2 loss functions (FAPE, pLDDT, PAE, violation losses)
  • Recycling
  • Dataset preprocessing
  • Full biochemical residue constants

Why "Mini"?

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.


Requirements

  • Python 3.10+
  • PyTorch

Install dependencies:

pip install torch

References

  • Jumper et al. Highly accurate protein structure prediction with AlphaFold. Nature (2021).
  • AlphaFold2 Supplementary Information.
  • OpenFold.

License

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.

Contributors

Yusufteppei

Issues