GNNLux GATConv/GATv2Conv initialize the attention vector `a` without the setup rng, so it's identical for every seed
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- julia
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Issue chỉ đến GNNLux/src/layers/conv.jl, tại các hàm khởi tạo GATConv và GATv2Conv, khoảng dòng 901 và 1058. Hãy đọc các constructor đó và so sánh cách các layer khác của GNNLux truyền RNG của setup vào init_weight; ví dụ tối thiểu trong issue cho thấy cách kiểm tra hành vi qua các seed khác nhau và với một initializer chỉ nhận RNG. Công việc được xem là hoàn tất khi cả hai vector attention đều dùng RNG được cung cấp và ví dụ không còn báo các vector giống nhau qua các seed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Julia
- Star
- 312
- Fork
- 76
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của JuliaGraphs/GraphNeuralNetworks.jl
-
gnngraphs
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
JuliaGraphs/GraphNeuralNetworks.jl#733 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
maintainance
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
GCNConv fails to compile with Reactant - MethodErrorCó thể đã có người làm @DHAKED440 đã nhận 8 ngày trước. Đang mởgnnlib lux
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Mooncake on CUDA issue trackerĐang mởflux gnngraphs gnnlib
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Test against Enzyme / Reactant?Đang mởmaintainance
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
JuliaGraphs/GraphNeuralNetworks.jl#655 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của JuliaGraphs/GraphNeuralNetworks.jl
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
MagneticResonanceImaging/MRIReco.jl#366 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
`AdamW` gives `NaN` for zero-gradient entries of `Float16` parameters (epsilon underflows to 0)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
FluxML/Optimisers.jl#253 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`poissonians` is not public, unlike `brownians` and `jumps`Có thể đã có người làm @isaacsas đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
SciML/ModelingToolkit.jl#5389 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`lower_throw!` treats any function whose name contains `jl_error` etc. as a throw (kernel becomes a trap / segfault)Có thể đã có người làm @sasmith-14 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
JuliaGPU/GPUCompiler.jl#1088 ·
Maintainer thường phản hồi trong vòng 1 ngày