Releases: Thomas-Rauter/edge2torch
Release list
edge2torch v0.2.0
edge2torch v0.2.0
Release date: 2026-06-26
Build sparsely connected PyTorch neural networks from prior-knowledge graphs,
with optional feature- and node-level attribution.
Documentation: https://thomas-rauter.github.io/edge2torch/0.2.0/
Highlights
This release extends node-level interpretation to all backends and makes the
default node-attribution output easier to use. If you used interpret_model()
on feedforward models in 0.1.0, read the breaking-change note below before
upgrading.
What's new
Node interpretation on recurrent and graphnn models
You can now attribute predictions to named hidden nodes on recurrent and
graphnn models, not only on feedforward. Feature attribution was already
available on all backends; node attribution now matches that coverage.
Typical workflow:
import edge2torch as e2t
node_importance = e2t.interpret_model(
model=trained_model,
artifact=artifact,
data=data,
target="nodes",
method="LayerConductance",
)More control over node attribution output
interpret_model() has new options when target="nodes":
| Option | What it does |
|---|---|
level="summary" |
One importance table per sample (default) |
level="sites" |
One table per interpretation site (layer_* on feedforward, step_* on recurrent and graphnn) |
nodes="hidden" |
Hidden nodes only (default) |
nodes="non_input" |
Hidden nodes plus output nodes |
nodes="all" |
All visible graph nodes |
site_aggregation |
On recurrent and graphnn summary output: "max_abs" (default), "mean_abs", or "last" |
Per-site detail when you need it:
node_attr_by_site = e2t.interpret_model(
model=trained_model,
artifact=artifact,
data=data,
target="nodes",
level="sites",
method="LayerConductance",
)New documentation and examples
- Recurrent example — cyclic graph, train, interpret
- GraphNN example — graph-native topology, train, interpret
- Scope and limitations — what each backend supports cleanly, with extra PyTorch work, or not at all
Breaking changes
interpret_model(..., target="nodes") default return type
Before (0.1.0): a dict of pandas.DataFrame objects, one per
interpretation site.
Now (0.2.0): a single summary pandas.DataFrame (rows = samples,
columns = selected nodes).
Migration: if you relied on per-site tables, add level="sites":
# 0.1.0 style
sites = interpret_model(..., target="nodes")
# 0.2.0 equivalent
sites = interpret_model(..., target="nodes", level="sites")The new default summary table is usually what you want for a first overview of
which named nodes matter.
Bug fixes
- GraphNN example notebook: corrected graph topology so the informative
signal path reaches the readout node as intended.
Install
pip install "edge2torch==0.2.0"With optional interpretation support (Captum):
pip install "edge2torch[interpret]==0.2.0"All extras:
pip install "edge2torch[all]==0.2.0"Requires Python 3.10+ and PyTorch 2.1+.
Links
Full changelog
Added
- Node interpretation on all backends. Attribute predictions to named
hidden nodes onrecurrentandgraphnnmodels, not onlyfeedforward. - Finer control over node attribution output via
level,nodes, and
site_aggregationoninterpret_model(). - New example notebooks for recurrent and graphnn end-to-end workflows.
- New docs page: Scope and limitations.
Changed
- Breaking:
interpret_model(..., target="nodes")returns a summary
pandas.DataFrameby default. Uselevel="sites"for per-site tables.
Fixed
- GraphNN example notebook: corrected graph topology so the signal path
reaches the readout node as intended.
edge2torch v0.1.0
edge2torch v0.1.0
Initial public release of edge2torch.
edge2torch builds sparse PyTorch neural networks from edge lists of named
nodes, with optional feature- and node-level attribution.
Highlights
- Compile named edge lists into PyTorch models with
compile_graph(). - Use one of three supported backends:
feedforward,recurrent, or
graphnn. - Align named input data features to compiled model input nodes with
align_features_to_input_nodes(). - Customize compiled models with
customize_model(). - Interpret trained models with Captum-based
interpret_model(), including
feature-level attribution and feedforward node-level attribution. - Use optional edge-level metadata such as
initial_weightandconstraint
to initialize or constrain individual edge weights. - Browse versioned documentation, examples, and API reference.
Installation
pip install edge2torchOptional interpretation support:
pip install "edge2torch[interpret]"