remove_nodes doesn't update graph_indicator on batched graphs
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
The issue identifies remove_nodes(g::GNNGraph{<:COO_T}, nodes_to_remove) and explains that graph_indicator retains entries for removed nodes. Read that method and compare its handling of graph_indicator with ndata; the issue suggests indexing by the kept nodes. Done means the indicator matches the remaining nodes and the batched unbatch and getgraph calls no longer raise BoundsError. An open linked pull request (#717) is already addressing this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
remove_nodes doesn't update graph_indicator, so on a batched graph the result keeps the old indicator (one entry per original node). The graph looks fine when printed, but unbatch / getgraph on it then throw a BoundsError.
MWE
using GNNGraphs, MLUtils
g = MLUtils.batch([rand_graph(3, 4, ndata = rand(Float32, 2, 3)),
rand_graph(4, 6, ndata = rand(Float32, 2, 4))])
g2 = remove_nodes(g, [1])
g2.num_nodes # 6
g2.graph_indicator # [1, 1, 1, 2, 2, 2, 2] -> still 7 entries, should be [1, 1, 2, 2, 2, 2]
MLUtils.unbatch(g2) # BoundsError: attempt to access 2×6 Matrix{Float32} at index [1:2, 4:7]
getgraph(g2, 2) # BoundsError: attempt to access 2×6 Matrix{Float32} at index [1:2, [4, 5, 6, 7]]
Node features, edges and the node count are all updated correctly, only graph_indicator is passed through unchanged in remove_nodes(g::GNNGraph{<:COO_T}, nodes_to_remove). Since remove_nodes(g, p) calls the same method, node dropping on a batch of graphs hits this too.
I think the fix is just to index the indicator with the kept nodes (g.graph_indicator[nodes_to_keep]) like is already done for ndata.
GNNGraphs master (17d1906, 1.6.0-DEV), Julia 1.12.1
- Lingua principale
- Julia
- Stelle
- 310
- Fork
- 74
- Merge medio
- 3g 23h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaGraphs/GraphNeuralNetworks.jl
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
JuliaGraphs/GraphNeuralNetworks.jl#655 · 12 commenti ·
Tutte le issue di JuliaGraphs/GraphNeuralNetworks.jl
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
documentation invalid
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
JuliaPhysics/BeamletOptics.jl#190 ·
I maintainer di solito rispondono entro 1 giorno
-
mul! with a Symmetric or Hermitian factor throws for a matrix view whose columns are not contiguousForse già presa @dkarrasch l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaLang/LinearAlgebra.jl#1829 ·
I maintainer di solito rispondono entro 1 giorno
-
`EnsembleSummary` `ci_type = :SEM` ribbon is `sqrt(N)` too wide for scalar statesForse già presa @isaacsas l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
SciML/SciMLBase.jl#1654 ·
I maintainer di solito rispondono entro 3 giorni