CarloLucibello / GraphNeuralNetworks.jl

Graph Neural Networks in Julia
https://carlolucibello.github.io/GraphNeuralNetworks.jl/dev/
MIT License
210 stars 47 forks source link

New `add_self_loops(g)` for hetero graphs #402

Closed rbSparky closed 4 months ago

rbSparky commented 4 months ago

As mentioned in PR #400, adding a new add_self_loops(g) function for hetero graphs would be helpful.

This PR does that.

Will integrate this function to be used in conv.jl.

CarloLucibello commented 4 months ago

No need to reimplement everything. The new method add_self_loops(hg) should just call the add_self_loops(hg, edge_t) on each edge type.

Then the docstring here https://github.com/CarloLucibello/GraphNeuralNetworks.jl/blob/5250c4dae953c70e6feae27f44df7d7f6a64eacc/src/GNNGraphs/transform.jl#L56 should be describe the additional behavior.

rbSparky commented 4 months ago

No need to reimplement everything. The new method add_self_loops(hg) should just call the add_self_loops(hg, edge_t) on each edge type.

Then the docstring here

https://github.com/CarloLucibello/GraphNeuralNetworks.jl/blob/5250c4dae953c70e6feae27f44df7d7f6a64eacc/src/GNNGraphs/transform.jl#L56

should be describe the additional behavior.

Changed function and changed docstring to include the new function and what it does

rbSparky commented 4 months ago

Once this is merged I can make a PR for GATv2 hetero using this function