Skip to content

Commit a5d7c09

Browse files
Update conv.jl
changed the aggr method to mean and got rid of dividing by in degrees (creating NAN)
1 parent 0f969b7 commit a5d7c09

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/layers/conv.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,6 @@ function (l::GMMConv)(g::GNNGraph, x::AbstractMatrix, e::AbstractMatrix)
11451145
@assert (ein == size(e)[1] && g.num_edges == size(e)[2]) "Pseudo-cordinate dimension is not equal to (ein,num_edge)"
11461146

11471147
num_edges = g.num_edges
1148-
d = degree(g, dir=:in)
11491148
w = reshape(e, (ein, 1, num_edges))
11501149
mu = reshape(l.mu, (ein, l.K, 1))
11511150

@@ -1155,9 +1154,8 @@ function (l::GMMConv)(g::GNNGraph, x::AbstractMatrix, e::AbstractMatrix)
11551154

11561155
xj = reshape(l.dense_x(x), (out, l.K, :)) # (out, K, num_nodes)
11571156

1158-
m = propagate(e_mul_xj, g, +, xj=xj, e=w)
1159-
m = dropdims(mean(m, dims=2), dims=2) # (out, num_nodes)
1160-
m = m ./ reshape(d, (1, g.num_nodes))
1157+
m = propagate(e_mul_xj, g, mean, xj=xj, e=w)
1158+
m = dropdims(mean(m, dims=2), dims=2) # (out, num_nodes)
11611159

11621160
m = l.σ(m .+ l.bias)
11631161

0 commit comments

Comments
 (0)