remove_nodes doesn't update graph_indicator on batched graphs
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Julia
- Estrellas
- 310
- Forks
- 74
- Merge medio
- 3 d 23 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de JuliaGraphs/GraphNeuralNetworks.jl
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Mooncake on CUDA issue trackerAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
Test against Enzyme / Reactant?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
JuliaGraphs/GraphNeuralNetworks.jl#655 · 12 comentarios ·
Todos los issues de JuliaGraphs/GraphNeuralNetworks.jl
Issues similares
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updatedPosiblemente ocupada @ali-ramadhan la tomó hoy. Abiertobug 🐞
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
CliMA/Oceananigans.jl#6381 ·
Los mantenedores suelen responder en 1 día
-
ci system:windows test
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
NumericalEarth/Breeze.jl#1143 ·
Los mantenedores suelen responder en 1 día
-
format-check (Runic) is red on master: formatter drift on ~200 filesPosiblemente ocupada @ChrisRackauckas-Claude la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SciML/ModelingToolkit.jl#5337 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
bug parsers
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
lanl-ansi/GasModels.jl#366 ·