GNNLux NNConv returns its state without the nn wrapper, so the state can't be fed back in
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- julia
調査の方向性
Start with GNNLux/src/layers/conv.jl at the reported NNConv state return around line 1673, then compare the state handling in EdgeConv and GINConv. Reproduce the failure by calling NNConv twice with the returned state or by running Lux.Training.single_train_step! twice; done means the returned state keeps the nn wrapper and the second call succeeds. The author says they plan to open a PR shortly, so check for work already underway.
索引モデルが issue の本文から書いたものです。
説明
In GNNLux, NNConv returns the inner network's state directly instead of wrapping it as (; nn = ...). Its input state is (; nn = ...) (from initialstates, and the forward pass reads st.nn), so the returned state has a different structure than the one it expects. Feeding it back into the layer then fails, which is what a training loop does on its second step.
Minimal example:
using GNNLux, Lux, Random
rng = Random.Xoshiro(0)
g = GNNGraph([1, 1, 2, 3], [2, 3, 1, 1])
x = randn(rng, Float32, 3, g.num_nodes)
e = randn(rng, Float32, 10, g.num_edges)
l = NNConv(3 => 5, Dense(10 => 15), tanh)
ps, st = Lux.setup(rng, l) # st == (nn = NamedTuple(),)
y, st2 = l(g, x, e, ps, st) # st2 == NamedTuple() <- `nn` wrapper is gone
l(g, x, e, ps, st2)
# ERROR: FieldError: type NamedTuple has no field `nn`; NamedTuple has no fields at all.
With a stateful inner network, e.g. Chain(Dense(10 => 15), BatchNorm(15)), the returned state is (layer_1 = ..., layer_2 = ...) and the second call fails the same way (type NamedTuple has no field nn, available fields: layer_1, layer_2).
The same thing happens with Lux.Training.single_train_step!: the first step works, the second one throws the FieldError, so an NNConv model can't be trained with the standard Lux training loop.
Expected: the returned state has the same structure as the input, (; nn = <updated nn state>), like EdgeConv and GINConv already do.
Actual: NNConv returns _getstate(nn) without the nn key (GNNLux/src/layers/conv.jl#L1673).
This is the same kind of problem that #715 fixed for GNNChain. The current tests don't catch it because test_lux_layer never passes the returned state back in.
Versions: Julia 1.13.3, GNNLux 0.3.0-DEV (master at aa2926c), Lux 1.31.5.
I'd like to fix this, will open a PR shortly.
- 主要言語
- Julia
- スター
- 310
- フォーク
- 75
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaGraphs/GraphNeuralNetworks.jl のほかの issue
-
lux
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
メンテナーはふだん 2 日以内に返信
-
gnngraphs
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaGraphs/GraphNeuralNetworks.jl#733 ·
メンテナーはふだん 2 日以内に返信
-
Unused output of node type leads to index error in Zygote対応中かも @lenianiva が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
JuliaGraphs/GraphNeuralNetworks.jl#731 ·
メンテナーはふだん 2 日以内に返信
-
maintainance
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
メンテナーはふだん 2 日以内に返信
-
GCNConv fails to compile with Reactant - MethodError対応中かも @DHAKED440 が 4 日前に担当しました。 オープンgnnlib lux
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
メンテナーはふだん 2 日以内に返信
JuliaGraphs/GraphNeuralNetworks.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100