GNNLux GATConv/GATv2Conv initialize the attention vector `a` without the setup rng, so it's identical for every seed
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- julia
調査の方向性
issueでは、GNNLux/src/layers/conv.jl の GATConv と GATv2Conv の初期化子(901行目と1058行目付近)が示されています。これらのコンストラクターを読み、他の GNNLux のレイヤーが setup の RNG を init_weight に渡す方法と比較してください。issue の最小例では、異なる seed 間での動作と、RNG のみを受け取る初期化子での動作を確認できます。完了条件は、両方の attention ベクトルが渡された RNG を使い、異なる seed でもベクトルが同一だと例が報告しなくなることです。
索引モデルが issue の本文から書いたものです。
説明
In GNNLux, GATConv and GATv2Conv create the attention parameter a without passing the rng given to initialparameters:
a = l.init_weight(ein > 0 ? 3out : 2out, l.heads) # GATConv
a = l.init_weight(out, l.heads) # GATv2Conv
With the default glorot_uniform, the rng-less WeightInitializers method falls back to its internal fixed Xoshiro(1234), so a comes out the same no matter which rng is passed to Lux.setup. Every GAT layer with the same shape therefore starts with an identical attention vector, and changing the seed (e.g. for multiple runs or an ensemble) doesn't change it. A custom init_weight that only has an (rng, dims...) method would also fail here with a MethodError.
Minimal example
using GNNLux, Lux, Random
for L in (GATConv(3 => 4; heads = 2), GATv2Conv(3 => 4; heads = 2))
p0 = Lux.setup(Xoshiro(0), L)[1]
p1 = Lux.setup(Xoshiro(1), L)[1]
println(nameof(typeof(L)), ": a equal across seeds = ", p0.a == p1.a,
", first Dense weight equal across seeds = ", first(values(p0)).weight == first(values(p1)).weight)
end
# init_weight is called without an rng for `a`
calls = Any[]
myinit(rng::AbstractRNG, dims::Integer...) = (push!(calls, (typeof(rng), dims)); zeros(Float32, dims...))
myinit(dims::Integer...) = (push!(calls, ("no rng", dims)); zeros(Float32, dims...))
Lux.setup(Xoshiro(0), GATv2Conv(3 => 4; heads = 2, init_weight = myinit))
println(calls)
Output (Julia 1.13.3, GNNLux 0.3.0, Lux 1.31.6, WeightInitializers 1.3.5, CPU):
GATConv: a equal across seeds = true, first Dense weight equal across seeds = false
GATv2Conv: a equal across seeds = true, first Dense weight equal across seeds = false
Any[(Xoshiro, (8, 3)), (Xoshiro, (8, 3)), ("no rng", (4, 2))]
The Dense sublayers react to the seed, but a doesn't. The two lines above are unchanged on current master (54025c6), so I expect the same behaviour there, though I ran the example against the registered 0.3.0.
Expected
a should be drawn from the rng passed to initialparameters, i.e. l.init_weight(rng, ...), like the other GNNLux layers (GCNConv, GMMConv, NNConv, ...).
Related (smaller)
In GNNLux GATConv, dense_x and dense_e are built as Dense(... , use_bias = false) without passing init_weight (L888-889), so a custom init_weight only affects a. GATv2Conv passes init_weight to its dense_i/dense_j/dense_e. Happy to split this into a separate issue if you prefer.
- 主要言語
- Julia
- スター
- 312
- フォーク
- 76
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaGraphs/GraphNeuralNetworks.jl のほかの issue
-
gnngraphs
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaGraphs/GraphNeuralNetworks.jl#733 ·
メンテナーはふだん 2 日以内に返信
-
maintainance
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
メンテナーはふだん 2 日以内に返信
-
GCNConv fails to compile with Reactant - MethodError対応中かも @DHAKED440 が 8 日前に担当しました。 オープンgnnlib lux
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
メンテナーはふだん 2 日以内に返信
-
flux gnngraphs gnnlib
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
maintainance
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
JuliaGraphs/GraphNeuralNetworks.jl#655 · コメント 12 件 ·
メンテナーはふだん 2 日以内に返信
JuliaGraphs/GraphNeuralNetworks.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
MagneticResonanceImaging/MRIReco.jl#366 ·
メンテナーはふだん 3 日以内に返信
-
`AdamW` gives `NaN` for zero-gradient entries of `Float16` parameters (epsilon underflows to 0)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
FluxML/Optimisers.jl#253 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
`poissonians` is not public, unlike `brownians` and `jumps`対応中かも @isaacsas が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
SciML/ModelingToolkit.jl#5389 ·
メンテナーはふだん 2 日以内に返信
-
`lower_throw!` treats any function whose name contains `jl_error` etc. as a throw (kernel becomes a trap / segfault)対応中かも @sasmith-14 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
JuliaGPU/GPUCompiler.jl#1088 ·
メンテナーはふだん 1 日以内に返信