Skip to content

Commit 74c1184

Browse files
committed
Add EvolveGNCO docs
1 parent 8c42880 commit 74c1184

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

GNNLux/src/layers/temporalconv.jl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,44 @@ y, st = l(g, x, ps, st) # result size (5, 5)
480480
"""
481481
DCGRU(ch::Pair{Int, Int}, k::Int; kwargs...) = GNNLux.StatefulRecurrentCell(DCGRUCell(ch, k; kwargs...))
482482

483+
"""
484+
EvolveGCNO(ch; use_bias = true, init_weight = glorot_uniform, init_state = zeros32, init_bias = zeros32)
485+
486+
Evolving Graph Convolutional Network (EvolveGCNO) layer from the paper [EvolveGCN: Evolving Graph Convolutional Networks for Dynamic Graphs](https://arxiv.org/pdf/1902.10191).
487+
488+
Perfoms a Graph Convolutional layer with parameters derived from a Long Short-Term Memory (LSTM) layer across the snapshots of the temporal graph.
489+
490+
491+
# Arguments
492+
493+
- `in`: Number of input features.
494+
- `out`: Number of output features.
495+
- `use_bias`: Add learnable bias. Default `true`.
496+
- `init_weight`: Weights' initializer. Default `glorot_uniform`.
497+
- `init_state`: Initial state of the hidden stat of the GRU layer. Default `zeros32`.
498+
- `init_bias`: Bias initializer. Default `zeros32`.
499+
500+
# Examples
501+
502+
```julia
503+
using GNNLux, Lux, Random
504+
505+
# initialize random number generator
506+
rng = Random.default_rng()
507+
508+
# create data
509+
tg = TemporalSnapshotsGNNGraph([rand_graph(rng, 10, 20; ndata = rand(rng, 4, 10)), rand_graph(rng, 10, 14; ndata = rand(rng, 4, 10)), rand_graph(rng, 10, 22; ndata = rand(rng, 4, 10))])
510+
511+
# create layer
512+
l = EvolveGCNO(4 => 5)
513+
514+
# setup layer
515+
ps, st = LuxCore.setup(rng, l)
516+
517+
# forward pass
518+
y, st = l(tg, tg.ndata.x , ps, st) # result size 3, size y[1] (5, 10)
519+
```
520+
"""
483521
@concrete struct EvolveGCNO <: GNNLayer
484522
in_dims::Int
485523
out_dims::Int

0 commit comments

Comments
 (0)