EnerGNN
A Graph Neural Network library based on JAX and Flax, specifically designed for real-life energy networks and large complex industrial infrastructures.
EnerGNN provides:
- A Hyper Heterogeneous Multi Graph (H2MG) data representation.
- A Graph Neural Network (GNN) library robust to structure variations (outages, reconfigurations, etc.).
- A clear interface to apply GNNs to custom use-cases (optimization, simulation, etc.).
Documentation
You can find the full documentation on ReadTheDocs.
Installation
EnerGNN is available on PyPI for Python >= 3.11.
pip install energnn
If you want to install the extra GPU dependencies, use:
pip install energnn[gpu]
Quick Start
This example shows how to train a small GNN to solve a linear system (DC Power Flow) modeled as a graph.
import optax
from energnn.problem.example import LinearSystemProblemLoader
from energnn.model.ready_to_use import TinyRecurrentEquivariantGNN
from energnn.trainer import Trainer
# 1. Load a problem (DC Power Flow linear systems)
problem_loader = LinearSystemProblemLoader(seed=1)
# 2. Initialize a model
model = TinyRecurrentEquivariantGNN(
in_structure=problem_loader.context_structure,
out_structure=problem_loader.decision_structure,
)
# 3. Train the model
trainer = Trainer(model=model, gradient_transformation=optax.adam(1e-3))
trainer.train(train_loader=problem_loader, n_epochs=10)
# 4. Use the model
for problem_batch in problem_loader:
context_batch, _ = problem_batch.get_context()
decision_batch, _ = model.forward_batch(graph=context_batch)
break
Development
To build this package locally from sources, we recommend using uv:
uv sync
# Or for GPU support
uv sync --extra gpu
Supporting Institutions
| RTE | Université de Liège | INRIA |
|---|---|---|
Cite Us
@software{energnn,
author = {{Committers of EnerGNN}},
title = {{EnerGNN: A Graph Neural Network library for real-life Energy networks.}},
url = {https://github.com/energnn},
}
Metadata
Release files for energnn 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| energnn-0.3.0.tar.gz | 870.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| energnn-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 949.2 kB
Release files / energnn-0.3.0.tar.gz
| Download URL | energnn-0.3.0.tar.gz |
|---|---|
| Size | 870.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3afa5355a84b96f216b27e7d0a808416c56e9a7231a760cb4a86c9de2781ecb0
|
|
BLAKE2b-256 checksum How to use checksums |
25b7fcd86ad8d2a4f5cdf76bedb76cc0ed5a760e764e539cf53cec6f2bfa7500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / energnn-0.3.0-py3-none-any.whl
| Download URL | energnn-0.3.0-py3-none-any.whl |
|---|---|
| Size | 79.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9d038991f5d9595ec1239c6bb3fa89825faadb4d5b396d0e03fe6c68f4e3311
|
|
BLAKE2b-256 checksum How to use checksums |
d8465bf7b0535ace81acd17610ea62b0259d390646197a4b8fc2ef2237fa9ac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|