add_nodes and add_edges leave graph_indicator inconsistent on batched graphs
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Read GNNGraphs/src/transform.jl, focusing on add_nodes and add_edges, and compare their handling of graph_indicator with the remove_nodes fix in PR #717. Decide or confirm the intended semantics for assigning new nodes in a batched graph, then check that the indicator stays consistent and sorted. Done when the chosen behavior is documented and tests cover batched additions, including the reported examples.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
add_nodes and add_edges (when the new edges reference nodes beyond num_nodes) increase num_nodes but pass g.graph_indicator through unchanged. On a batched graph this leaves graph_indicator shorter than num_nodes:
using GNNGraphs
g = batch([rand_graph(3, 4), rand_graph(4, 6)])
g.num_nodes, length(g.graph_indicator) # (7, 7)
g1 = add_nodes(g, 2)
g1.num_nodes, length(g1.graph_indicator) # (9, 7)
g2 = add_edges(g, [8], [1])
g2.num_nodes, length(g2.graph_indicator) # (8, 7)
The resulting graph is inconsistent, so functions relying on graph_indicator (e.g. unbatch, getgraph, graph-level pooling) are likely to misbehave or error on it. The relevant code is add_nodes and add_edges in GNNGraphs/src/transform.jl, which both build the new GNNGraph with g.graph_indicator.
It's not a one-line fix because the correct behavior is ambiguous: it's unclear which graph of the batch the new nodes belong to. Options:
- Add a keyword (e.g.
graph = ...) to assign the new nodes to an existing graph, extendinggraph_indicatoraccordingly (and keeping it sorted, whichunbatchrequires). - Allow the new nodes to be appended as a new graph.
- Throw an informative error for batched graphs (
g.num_graphs > 1) until the semantics are decided.
Found while reviewing #717, which fixes the same class of inconsistency for remove_nodes.
🧔♂️🤖 Assisted by AI
- Lenguaje dominante
- Julia
- Estrellas
- 310
- Forks
- 75
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 10
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
-
lux
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
JuliaGraphs/GraphNeuralNetworks.jl#732 ·
Los mantenedores suelen responder en 2 días
-
Unused output of node type leads to index error in ZygotePosiblemente ocupada @lenianiva la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
JuliaGraphs/GraphNeuralNetworks.jl#731 ·
Los mantenedores suelen responder en 2 días
-
maintainance
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
JuliaGraphs/GraphNeuralNetworks.jl#725 ·
Los mantenedores suelen responder en 2 días
-
GCNConv fails to compile with Reactant - MethodErrorPosiblemente ocupada @DHAKED440 la tomó hace 3 días. Abiertognnlib lux
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
JuliaGraphs/GraphNeuralNetworks.jl#710 ·
Los mantenedores suelen responder en 2 días
-
Mooncake on CUDA issue trackerAbiertoflux gnngraphs gnnlib
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
JuliaGraphs/GraphNeuralNetworks.jl#702 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de JuliaGraphs/GraphNeuralNetworks.jl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
erfinv(::Float16) and erfcinv(::Float16) are wrong for abs(x) <= 0.75 (erfinv(Float16(0)) == 0.2201)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
JuliaMath/SpecialFunctions.jl#571 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100