Polynomial Group-Convolutional Neural Networks (PGCNN)
A Python/Sage package for algebraic analysis of Polynomial Group-Convolutional Neural Networks, including:
- symbolic computation of network parametrization maps
- image dimension computation
- generic fiber size computation
- algebraic geometry analysis via Macaulay2
The package integrates:
- SageMath for symbolic computation and group algebra
- Macaulay2 (with the
Cremonapackage) for algebraic geometry computations.
The package requires the following software:
- Python ≥ 3.9
- SageMath
- Macaulay2
- Macaulay2 package Cremona
Because SageMath is not a standard pip dependency, this package must be installed using Sage’s Python environment.
Follow the instructions for your system:
https://doc.sagemath.org/html/en/installation/index.html
Verify installation:
sage --versionInstructions:
Verify installation:
M2
Inside Macaulay2 install the Cremona package:
installPackage "Cremona"
sage -python -m pip install pgcnnStart Sage Python:
sage -pythonRun the following test:
from sage.all import CyclicPermutationGroup
from pgcnn import PGCNN
G = CyclicPermutationGroup(2)
net = PGCNN(G, [1])
print(net.compute_dim_image_Phi_sage())If this runs without errors, the installation is successful.
from sage.all import CyclicPermutationGroup
from pgcnn import PGCNN
# Define a group
G = CyclicPermutationGroup(3)
# Define activation exponents
r = [1, 2]
# Create network
net = PGCNN(G, r)
# Compute image dimension
dim = net.compute_dim_image_Phi_sage()
print("Image dimension:", dim)See example.sage for more examples.
If you use this package in research, please cite our paper.
@misc{hendi2026geometrypolynomialgroupconvolutional,
title = {The Geometry of Polynomial Group Convolutional Neural Networks},
author = {Yacoub Hendi and Daniel Persson and Magdalena Larfors},
year = {2026},
eprint = {2603.29566},
archivePrefix= {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2603.29566},
}MIT License.