CarloLucibello / GraphNeuralNetworks.jl

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

Add `TemporalGraphConv` #369

Closed aurorarossi closed 5 months ago

aurorarossi commented 5 months ago

This PR adds a TemporalGraphConv constructor to each snapshot of the TemporalSnapshotsGNNGraph, a convolutional homogeneous graph layer. A PR will follow to update the documentation.

CarloLucibello commented 5 months ago

I think that instead of introducing a new layer, we can extend all layers to take a temporalsnapshotgraph as input and apply itself timewise. The time dimension in this way is like a batch dimension. It would be something like

function (l::GNNLayer)(g::TemporalSnapshotsGNNGraph, x::AbstractVector; kws...)
    y = ....
    return y
end  

Maybe the operation could be made more efficient batching the snapshots first and then unbatching the output y later, but this is a performance optimization that can be explored later.

aurorarossi commented 5 months ago

Ah ok I see. Do you prefer one big PR with support for TemporalSnapshotsGNNGraphs for all layers or one PR for each layer? In both cases I will close this PR. Thanks!