Skip to content

Commit 4deb30e

Browse files
propagate
1 parent 0d24bfd commit 4deb30e

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/msgpass.jl

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,30 @@
22
# "Relational inductive biases, deep learning, and graph networks"
33

44
"""
5-
propagate(mp, g::GNNGraph, aggr)
6-
propagate(mp, g::GNNGraph, E, X, u, aggr)
5+
propagate(mp, g, X, E, U, aggr)
76
8-
Perform the sequence of operation implementing the message-passing scheme
9-
and updating node, edge, and global features `X`, `E`, and `u` respectively.
7+
Perform the sequence of operations implementing the message-passing scheme
8+
on graph `g` with convolution layer `mp`.
9+
Updates the node, edge, and global features `X`, `E`, and `U` respectively.
1010
1111
The computation involved is the following:
1212
1313
```julia
14-
M = compute_batch_message(mp, g, E, X, u)
15-
E = update_edge(mp, M, E, u)
14+
M = compute_batch_message(mp, g, X, E, U)
1615
M̄ = aggregate_neighbors(mp, aggr, g, M)
17-
X = update(mp, M̄, X, u)
18-
u = update_global(mp, E, X, u)
16+
X′ = update(mp, X, M̄, U)
17+
E′ = update_edge(mp, M, E, U)
18+
U′ = update_global(mp, U, X′, E′)
1919
```
2020
2121
Custom layers typically define their own [`update`](@ref)
22-
and [`message`](@ref) function, then call
22+
and [`message`](@ref) functions, then call
2323
this method in the forward pass:
2424
2525
```julia
2626
function (l::MyLayer)(g, X)
2727
... some prepocessing if needed ...
28-
E = nothing
29-
u = nothing
30-
propagate(l, g, E, X, u, +)
28+
propagate(l, g, X, E, U, +)
3129
end
3230
```
3331
@@ -36,8 +34,8 @@ See also [`message`](@ref) and [`update`](@ref).
3634
function propagate end
3735

3836
function propagate(mp, g::GNNGraph, aggr)
39-
E, X, U = propagate(mp, g,
40-
edge_features(g), node_features(g), global_features(g),
37+
X, E, U = propagate(mp, g,
38+
node_features(g), edge_features(g), global_features(g),
4139
aggr)
4240
GNNGraph(g, ndata=X, edata=E, gdata=U)
4341
end

0 commit comments

Comments
 (0)