Skip to content

feat: Add AGNNConv support for HeteroGraphConv - #649

Merged
CarloLucibello merged 7 commits into
JuliaGraphs:masterfrom
i-Amogh:AKS/AGNNHetero
Nov 29, 2026
Merged

CarloLucibello merged 7 commits into
JuliaGraphs:masterfrom
i-Amogh:AKS/AGNNHetero

Conversation

@i-Amogh

@i-Amogh i-Amogh commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds AGNNConv support for HeteroGraphConv (part of #311).

  • AGNNConv accepts a tuple (xj, xi) of source and target node features, so it works in HeteroGraphConv (GraphNeuralNetworks.jl) and on single-relation heterographs (GNNLux.jl).
  • With add_self_loops = true, self loops are only added to relations whose source and target node types coincide.
  • Tests check outputs against a hand-written reference and against the homogeneous layer on the union graph.
  • Docs: tick Heterograph and untick the wrong Edge Features for AGNNConv.

🧔‍♂️🤖 Assisted by Claude Opus 5.5

Comment thread GNNlib/src/layers/conv.jl Outdated
function agnn_conv(l, g::GNNGraph, x::AbstractMatrix)
check_num_nodes(g, x)
if l.add_self_loops
function agnn_conv(g::AbstractGNNGraph, x, β; self_loops=true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the agnn_conv interface should not be changed

Comment thread GNNlib/src/layers/conv.jl Resolved
Comment thread GNNlib/src/layers/conv.jl Resolved
Amogh and others added 6 commits November 29, 2026 09:17
The bipartite test in the AGNNConv GPU item used a GNNGraph with feature
matrices of different sizes, which fails check_num_nodes, and was never run
on CPU. Replace it with value checks against a hand-written AGNN reference
(homogeneous and (xj, xi) input), compare HeteroGraphConv outputs with the
homogeneous layer on the graph with nodes A ∪ B, and add a Lux tuple-input
check. Also revert a stray whitespace edit in the GCNConv hetero testset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe the (xj, xi) forward input, state that no self loops are added to
relations between different node types, define `x` in the examples, and tick
the Heterograph column for AGNNConv in the docs tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGNNConv with tuple input needs the new GNNlib.agnn_conv, in both frontends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGNNConv takes no edge features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CarloLucibello
CarloLucibello merged commit f3be1f0 into JuliaGraphs:master Nov 29, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants