Graph networks that stay calm through rotations and translations
It implements graph layers that jointly update node features and 3D coordinates while keeping the network honest under rotation and translation.

What it does
This is a PyTorch implementation of E(n)-Equivariant Graph Neural Networks. It provides EGNN layers and a full EGNN_Network that consume node features and 3D coordinates, update both through message passing, and enforce equivariance to rotations and translations. The README notes the underlying technique was aimed at dynamical systems and molecular activity prediction, and suggests possible use for AlphaFold2 replication down the line.
The interesting bit
Instead of wrestling with Lie-group representations like SE3 Transformer, the architecture leans on simple invariant features—relative distances and angles—to achieve equivariance. The README claims this straightforward approach outperformed prior geometric methods in both accuracy and speed.
Key highlights
- Operates on both node features (
feats) and Cartesian coordinates (coors) simultaneously. - Supports continuous edge features, sparse neighbor constraints via adjacency matrices, and Nth-order neighbor embeddings.
- Includes stabilization switches—coordinate normalization and weight clamping—for high neighbor counts.
- Offers fine-grained control over which tensors get updated (
update_feats,update_coors) and how messages are pooled. - Ships with a protein backbone denoising example.
Caveats
- A masking bug in neighbor selection existed prior to version 0.1.12; the README warns that earlier masked experiments should be rerun.
- The initial architecture suffered from instability with a high number of neighbors, and the README presents coordinate normalization and weight clamping as the primary mitigations.
Verdict
Worth a look if you are building geometric deep learning models for molecules or point clouds and need equivariance without the usual representation-theory overhead. Skip it if you are after a general-purpose graph network that ignores spatial geometry.
Frequently asked
- What is lucidrains/egnn-pytorch?
- It implements graph layers that jointly update node features and 3D coordinates while keeping the network honest under rotation and translation.
- Is egnn-pytorch open source?
- Yes — lucidrains/egnn-pytorch is open source, released under the MIT license.
- What language is egnn-pytorch written in?
- lucidrains/egnn-pytorch is primarily written in Python.
- How popular is egnn-pytorch?
- lucidrains/egnn-pytorch has 531 stars on GitHub.
- Where can I find egnn-pytorch?
- lucidrains/egnn-pytorch is on GitHub at https://github.com/lucidrains/egnn-pytorch.