Skip to content

Commit 4e14f67

Browse files
Update documentation for convolutions on TemporalSnapshotsGNNGraphs (#379)
* Update table add GINConv * Add example in the docs * Fix spaces and name Co-authored-by: Carlo Lucibello <[email protected]> * Fix other spaces --------- Co-authored-by: Carlo Lucibello <[email protected]>
1 parent 5148d96 commit 4e14f67

File tree

2 files changed

+41
-20
lines changed

2 files changed

+41
-20
lines changed

docs/src/api/conv.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,28 @@ The table below lists all graph convolutional layers implemented in the *GraphNe
1313
- *Edge Weight*: supports scalar weights (or equivalently scalar features) on edges.
1414
- *Edge Features*: supports feature vectors on edges.
1515
- *Heterograph*: supports heterogeneous graphs (see [`GNNHeteroGraph`](@ref)).
16+
- *TemporalSnapshotsGNNGraphs*: supports temporal graphs (see [`TemporalSnapshotsGNNGraph`](@ref)) by applying the convolution layers to each snapshot independently.
1617

17-
| Layer |Sparse Ops|Edge Weight|Edge Features| Heterograph |
18-
| :-------- | :---: |:---: |:---: | :---: |
19-
| [`AGNNConv`](@ref) | | || |
20-
| [`CGConv`](@ref) | | || |
21-
| [`ChebConv`](@ref) | | | | |
22-
| [`EGNNConv`](@ref) | | || |
23-
| [`EdgeConv`](@ref) | | | | |
24-
| [`GATConv`](@ref) | | || |
25-
| [`GATv2Conv`](@ref) | | || |
26-
| [`GatedGraphConv`](@ref) || | | |
27-
| [`GCNConv`](@ref) ||| | |
28-
| [`GINConv`](@ref) || | | |
29-
| [`GMMConv`](@ref) | | || |
30-
| [`GraphConv`](@ref) || | ||
31-
| [`MEGNetConv`](@ref) | | || |
32-
| [`NNConv`](@ref) | | || |
33-
| [`ResGatedGraphConv`](@ref) | | | | |
34-
| [`SAGEConv`](@ref) || | | |
35-
| [`SGConv`](@ref) || | | |
36-
| [`TransformerConv`](@ref) | | || |
18+
| Layer |Sparse Ops|Edge Weight|Edge Features| Heterograph | TemporalSnapshotsGNNGraphs |
19+
| :-------- | :---: |:---: |:---: | :---: | :---: |
20+
| [`AGNNConv`](@ref) | | || | |
21+
| [`CGConv`](@ref) | | || | |
22+
| [`ChebConv`](@ref) | | | | | |
23+
| [`EGNNConv`](@ref) | | || | |
24+
| [`EdgeConv`](@ref) | | | | | |
25+
| [`GATConv`](@ref) | | || | |
26+
| [`GATv2Conv`](@ref) | | || | |
27+
| [`GatedGraphConv`](@ref) || | | | |
28+
| [`GCNConv`](@ref) ||| | | |
29+
| [`GINConv`](@ref) || | | ||
30+
| [`GMMConv`](@ref) | | || | |
31+
| [`GraphConv`](@ref) || | || |
32+
| [`MEGNetConv`](@ref) | | || | |
33+
| [`NNConv`](@ref) | | || | |
34+
| [`ResGatedGraphConv`](@ref) | | | | | |
35+
| [`SAGEConv`](@ref) || | | | |
36+
| [`SGConv`](@ref) || | | | |
37+
| [`TransformerConv`](@ref) | | || | |
3738

3839

3940
## Docs

docs/src/temporalgraph.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,23 @@ julia> tg.ndata # vector of Datastore for node features
121121
julia> typeof(tg.ndata.x) # vector containing the x feature of each snapshot
122122
Vector{Matrix{Float64}}
123123
```
124+
125+
## Graph convolutions on TemporalSnapshotsGNNGraph
126+
127+
A graph convolutional layer can be applied to each snapshot independently, in the next example we apply a `GINConv` layer to each snapshot of a `TemporalSnapshotsGNNGraph`. The list of compatible graph convolution layers can be found [here](api/conv.md).
128+
129+
```jldoctest
130+
julia> using GraphNeuralNetworks, Flux
131+
132+
julia> snapshots = [rand_graph(10, 20; ndata = rand(3, 10)), rand_graph(10, 14; ndata = rand(3, 10))];
133+
134+
julia> tg = TemporalSnapshotsGNNGraph(snapshots);
135+
136+
julia> m = GINConv(Dense(3 => 1), 0.4);
137+
138+
julia> output = m(tg, tg.ndata.x);
139+
140+
julia> size(output[1])
141+
(1, 10)
142+
```
143+

0 commit comments

Comments
 (0)