GNNLux MEGNetConv drops the state of stateful sublayers
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- julia
- Domain
- machine-learning
Research direction
Read the MEGNetConv forward pass and compare how EdgeConv, GINConv, and NNConv return updated sublayer state. Add a regression test using BatchNorm in ϕe that checks whether its running statistics change after a training-mode call, then confirm the test passes with the updated state returned.
Written by the indexing model from the issue text.
Description
GNNLux.MEGNetConv wraps ϕe and ϕv in StatefulLuxLayer{true}, but its forward pass returns the input state unchanged:
function (l::MEGNetConv)(g, x, e, ps, st)
ϕe = StatefulLuxLayer{true}(l.ϕe, ps.ϕe, _getstate(st, :ϕe))
ϕv = StatefulLuxLayer{true}(l.ϕv, ps.ϕv, _getstate(st, :ϕv))
m = (; ϕe, ϕv, aggr=l.aggr)
return GNNlib.megnet_conv(m, g, x, e), st
end
Any state update performed by a sublayer is therefore dropped. The default constructor only builds Dense chains, which are stateless, but the MEGNetConv(in_dims, out_dims, ϕe, ϕv; aggr) constructor accepts arbitrary layers. With a stateful one, e.g. BatchNorm or Dropout inside ϕe/ϕv, the running statistics (or RNG) never advance in training mode.
The same pattern is already used by EdgeConv, GINConv and, since #728, NNConv:
stnew = (; ϕe = _getstate(ϕe), ϕv = _getstate(ϕv))
return GNNlib.megnet_conv(m, g, x, e), stnew
This was found by reading the code while reviewing #728 and has not been reproduced yet; a regression test with a BatchNorm in ϕe (checking that the running stats change after a training-mode call) would pin it down. Related: #727.
The other layers with sublayer fields (CGConv, EGNNConv, GATConv, GATv2Conv, GMMConv, GatedGraphConv) have the same return-st pattern, but their constructors only create Dense/Chain of Dense sublayers (plus a GRUCell in GatedGraphConv, whose rng state doesn't appear to be used there), so nothing seems to be lost in practice.
🧔♂️🤖 Assisted by AI
- Dominant language
- Julia
- Stars
- 310
- Forks
- 75
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphs/GraphNeuralNetworks.jl
-
gnngraphs
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#733 ·
Maintainers usually reply within 2 days
-
Unused output of node type leads to index error in ZygotePossibly taken @lenianiva claimed this 1 day ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaGraphs/GraphNeuralNetworks.jl#731 ·
Maintainers usually reply within 2 days
-
maintainance
Difficulty 3/5 1-2 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
Maintainers usually reply within 2 days
-
GCNConv fails to compile with Reactant - MethodErrorPossibly taken @DHAKED440 claimed this 3 days ago. Opengnnlib lux
Difficulty 3/5 1-2 days Newbie friendliness 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
Maintainers usually reply within 2 days
-
flux gnngraphs gnnlib
Difficulty 4/5 3-5 days Newbie friendliness 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 comment ·
Maintainers usually reply within 2 days
All issues in JuliaGraphs/GraphNeuralNetworks.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100