This repository contains the implementation of the paper:
G-RepsNets: A Fast and General Construction of Equivariant Networks for Arbitrary Matrix Groups
Sourya Basu, Suhas Lohit, Matthew Brand
Transactions on Machine Learning Research (TMLR), 2025
Group equivariance is a strong inductive bias useful in a wide range of deep learning tasks. However, constructing efficient equivariant networks for general groups and domains is difficult. Recent work on equivariant multi-layer perceptrons (EMLPs) by Finzi et al. directly solves the equivariance constraint for arbitrary matrix groups to obtain EMLPs, but this method does not scale well, and scaling is crucial in deep learning. Here, we introduce Group Representation Networks (G-RepsNets), a lightweight equivariant network for arbitrary matrix groups with features represented using tensor polynomials. The key insight in our design is that using tensor representations in the hidden layers of a neural network along with simple inexpensive tensor operations leads to scalable equivariant networks. Further, these networks are universal approximators of functions equivariant to orthogonal groups. We find G-RepsNet to be competitive to EMLP on several tasks with group symmetries such as
- First create a conda environment using
conda create --name grepsnet python=3.8
. - Activate the conda environment using
conda activate grepsnet
. - Then use
pip install -r requirements.txt
to install the remaining dependencies.
We have provided the G-RepsNet model definitions, training and testing code for the three synthetic tasks we use to compare against MLPs and EMLPs.
-
$O(5)$ -invariance:python o5_invariance.py
-
$O(3)$ -equivariance:python o3_equivariance.py
-
$SO(1,3)$ -invariance:python so13_invariance.py
See CONTRIBUTING.md for our policy on contributions.
Released under AGPL-3.0-or-later
license, as found in the LICENSE.md file.
All files, except as noted below:
Copyright (c) 2025 Mitsubishi Electric Research Laboratories (MERL)
SPDX-License-Identifier: AGPL-3.0-or-later
The dataset definitions in
models/o5_invariance.py
models/o3_equivariance.py
models/so13_invariance.py
were adapted from EMLP (license included in LICENSES/MIT.txt):
Copyright (c) 2025 Mitsubishi Electric Research Laboratories (MERL)
Copyright (c) 2021 mfinzi
SPDX-License-Identifier: AGPL-3.0-or-later
SPDX-License-Identifier: MIT
If you use our work, please use the following citation
@inproceedings{basu2025grepsnet,
title={G-RepsNet: A Fast and General Construction of Equivariant Networks for Arbitrary Matrix Groups},
author={Basu, Sourya and Lohit, Suhas and Brand, Matthew},
booktitle={Transactions on Machine Learning Research},
year={2025}
}