Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,10 @@ Entries link to the pull request that introduced them.
- Added an `EnzymeCore` package extension marking `scaled_laplacian` inactive for Enzyme, matching its existing `@non_differentiable` ChainRules declaration. Enzyme previously differentiated the Krylov eigensolve inside it and failed; this unblocks `ChebConv`, `GConvGRUCell` and `GConvLSTMCell` ([#706]).
- Enzyme can now differentiate through the adjacency-matrix → COO graph conversion: a new internal keyword-free helper `_to_coo_graph` avoids the union-typed keyword handling of the `GNNGraph(g; graph_type)` constructor and of `to_coo`, which Enzyme's type analysis cannot compile. Together with upstream fixes in Enzyme ≥ 0.13.197 this removes the `EnzymeInternalError` crash on `:dense`/`:sparse` graphs ([#703]).

## GNNLux.jl — Unreleased (towards 0.2.0)
## GNNLux.jl — Unreleased (towards 0.3.0)

**Added**
- Added pooling layers (`GlobalPool`, `GlobalAttentionPool`, `TopKPool`) ([#576]).
- `TGCN` now supports non-linear activation functions ([#596]).
- Rewrote the recurrent temporal layers following the Flux frontend's design ([#560]): added the `GNNRecurrence` wrapper and split every temporal layer into a `*Cell` and a full-sequence layer, exporting both — `TGCNCell`/`TGCN`, `GConvGRUCell`/`GConvGRU`, `GConvLSTMCell`/`GConvLSTM`, `DCGRUCell`/`DCGRU`, `EvolveGCNOCell`/`EvolveGCNO`. A layer now consumes a whole sequence at once (an `in × timesteps × num_nodes` array on a `GNNGraph`, or a vector of snapshots on a `TemporalSnapshotsGNNGraph`) and returns the full output sequence ([#696]).

**Changed**
- Bumped the NNlib, OneHotArrays, StableRNGs, and DocumenterInterLinks compat bounds ([#687], [#686], [#684], [#685]).
- The temporal cells now share their forward-pass math with the Flux frontend via new `GNNlib` functions, and several formulas were corrected in the process (e.g. the `GConvGRU` candidate state, previously `tanh` of the wrong term, and the `GConvLSTM` peephole connections) ([#696]).

**Removed**
- Removed the `A3TGCN` layer, mirroring its removal from the Flux frontend ([#696]).
**Fixed**
- `GNNChain` now returns its state with the same structure it receives, `(; layers = (; layer_1, ...))`, as the Lux layer interface requires. It previously returned the per-layer states without the `layers` wrapper, so feeding the returned state back into the chain (as `Lux.Training.single_train_step!` does) failed with a `FieldError`. This is breaking for code that worked around the bug by re-wrapping the state as `(; layers = st)`, as the docs examples did: drop the wrapper.

## GNNlib.jl — Unreleased (towards 1.4.1)

Expand All @@ -44,6 +35,20 @@ Entries link to the pull request that introduced them.
- `GNNRecurrence` now hands each cell an indexed time slice instead of an `eachslice` view, matching the Lux frontend. Enzyme's type analysis fails on `SubArray` cell inputs, so this unblocks `DCGRU`, `EvolveGCNO`, `GConvGRU` and `GConvLSTM` under Enzyme ([#707]).
- The recurrent temporal cells now delegate their forward-pass math to shared `GNNlib` functions (requires GNNlib ≥ 1.4); the layer behaviour is unchanged ([#696]).

## GNNLux.jl 0.2.0 — 2026-07-22

**Added**
- Added pooling layers (`GlobalPool`, `GlobalAttentionPool`, `TopKPool`) ([#576]).
- `TGCN` now supports non-linear activation functions ([#596]).
- Rewrote the recurrent temporal layers following the Flux frontend's design ([#560]): added the `GNNRecurrence` wrapper and split every temporal layer into a `*Cell` and a full-sequence layer, exporting both — `TGCNCell`/`TGCN`, `GConvGRUCell`/`GConvGRU`, `GConvLSTMCell`/`GConvLSTM`, `DCGRUCell`/`DCGRU`, `EvolveGCNOCell`/`EvolveGCNO`. A layer now consumes a whole sequence at once (an `in × timesteps × num_nodes` array on a `GNNGraph`, or a vector of snapshots on a `TemporalSnapshotsGNNGraph`) and returns the full output sequence ([#696]).

**Changed**
- Bumped the NNlib, OneHotArrays, StableRNGs, and DocumenterInterLinks compat bounds ([#687], [#686], [#684], [#685]).
- The temporal cells now share their forward-pass math with the Flux frontend via new `GNNlib` functions, and several formulas were corrected in the process (e.g. the `GConvGRU` candidate state, previously `tanh` of the wrong term, and the `GConvLSTM` peephole connections) ([#696]).

**Removed**
- Removed the `A3TGCN` layer, mirroring its removal from the Flux frontend ([#696]).

## GNNlib.jl 1.4.0 — 2026-07-22

**Added**
Expand Down
2 changes: 1 addition & 1 deletion GNNLux/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GNNLux"
uuid = "e8545f4d-a905-48ac-a8c4-ca114b98986d"
version = "0.2.0"
version = "0.3.0-DEV"
authors = ["Carlo Lucibello and contributors"]

[workspace]
Expand Down
3 changes: 1 addition & 2 deletions GNNLux/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Finally, we use a standard Lux training pipeline to fit our dataset.
function custom_loss(model, ps, st, tuple)
g,x,y = tuple
y_pred,st = model(g, x, ps, st)
return MSELoss()(y_pred, y), (layers = st,), 0
return MSELoss()(y_pred, y), st, 0
end

function train_model!(model, ps, st, train_graphs, test_graphs)
Expand All @@ -81,7 +81,6 @@ function train_model!(model, ps, st, train_graphs, test_graphs)
test_loss =0
for g in test_graphs
ŷ, st_ = model(g, g.x, train_state.parameters, st_)
st_ = (layers = st_,)
test_loss += MSELoss()(g.y,ŷ)
end
test_loss = test_loss/length(test_graphs)
Expand Down
2 changes: 1 addition & 1 deletion GNNLux/docs/src/tutorials/graph_classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function custom_loss(model, ps, st, tuple)
logitcrossentropy = CrossEntropyLoss(; logits=Val(true))
st = Lux.trainmode(st)
ŷ, st = model(g, x, ps, st)
return logitcrossentropy(ŷ, y), (; layers = st), 0
return logitcrossentropy(ŷ, y), st, 0
end

function eval_loss_accuracy(model, ps, st, data_loader)
Expand Down
2 changes: 1 addition & 1 deletion GNNLux/docs/src_tutorials/graph_classification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function custom_loss(model, ps, st, tuple)
logitcrossentropy = CrossEntropyLoss(; logits=Val(true))
st = Lux.trainmode(st)
ŷ, st = model(g, x, ps, st)
return logitcrossentropy(ŷ, y), (; layers = st), 0
return logitcrossentropy(ŷ, y), st, 0
end

function eval_loss_accuracy(model, ps, st, data_loader)
Expand Down
5 changes: 4 additions & 1 deletion GNNLux/src/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ Base.firstindex(c::GNNChain) = firstindex(c.layers)

LuxCore.outputsize(c::GNNChain) = LuxCore.outputsize(c.layers[end])

(c::GNNChain)(g::GNNGraph, x, ps, st) = _applychain(c.layers, g, x, ps.layers, st.layers)
function (c::GNNChain)(g::GNNGraph, x, ps, st)
x, st_layers = _applychain(c.layers, g, x, ps.layers, st.layers)
return x, (; layers = st_layers)
end

function _applychain(layers, g::GNNGraph, x, ps, st) # type-unstable path, helps compile times
newst = (;)
Expand Down
11 changes: 11 additions & 0 deletions GNNLux/test/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@
@test GNNChain <: LuxCore.AbstractLuxContainerLayer{(:layers,)}
c = GNNChain(GraphConv(3 => 5, tanh), GCNConv(5 => 3))
test_lux_layer(rng, c, g, x, outputsize=(3,), container=true)

# The returned state has the same structure as the input state,
# so it can be fed back into the chain (as in a training loop).
c = GNNChain(GCNConv(3 => 5, relu), Dropout(0.5), Dense(5 => 3))
ps, st = LuxCore.setup(rng, c)
y, st′ = c(g, x, ps, st)
@test typeof(st′) == typeof(st)
@test st′.layers.layer_2.rng != st.layers.layer_2.rng
y′, st″ = c(g, x, ps, st′)
@test typeof(st″) == typeof(st)
@test y′ != y
end
end
Loading