CarloLucibello / GraphNeuralNetworks.jl

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

GCNConv without normalization #277

Closed FDemelas closed 7 months ago

FDemelas commented 1 year ago

Hello, I'm trying to use GCNConv with negative edge weights, hence I would like to deactivate the normalization as clearly the square root of negative value is problematic. Is it possible in some way to deactivate the normalization (but still use the edge weights) or change with a personalized normalization?

CarloLucibello commented 1 year ago

Hi, we don't support that currently. It would be nice to add the possibility of a custom normalization (PR welcome!). As a quick workaround you can define your own custom layer by copying and pasting the GCNConv implementation and removing the normalization https://github.com/CarloLucibello/GraphNeuralNetworks.jl/blob/a7de26fc65e46f6f29208b8d365b9c0e79a1390a/src/layers/conv.jl#L125-L126

FDemelas commented 1 year ago

Thank you very much

rbSparky commented 7 months ago

Seems like a quick fix

@CarloLucibello should I create a PR that adds the possibility of custom normalization in GCNConv?

Edit: Made the PR