Skip to content

Commit 032f519

Browse files
aurorarossiCarloLucibello
authored andcommitted
Address GIN epsilon review feedback
1 parent f222a40 commit 032f519

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎GNNLux/src/layers/conv.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ y, st = l(g, x, ps, st) # size: out_channel × num_nodes
13411341
end
13421342

13431343
GINConv(nn, ϵ::Real; aggr = +, train_eps::Bool = false) =
1344-
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)
1344+
GINConv(nn, train_eps ? Float32[ϵ] : ϵ, aggr, train_eps)
13451345

13461346
GINConv(nn, ϵ::Real, aggr) = GINConv(nn, ϵ; aggr)
13471347

‎GNNLux/test/layers/conv.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ end
115115
ps = LuxCore.initialparameters(rng, l)
116116
@test !hasproperty(ps, :ϵ)
117117

118-
l = GINConv(nn; train_eps = true)
118+
l = GINConv(nn; ϵ = 0.5, train_eps = true)
119119
test_lux_layer(rng, l, g, x, sizey=(out_dims,g.num_nodes), container=true)
120120
ps = LuxCore.initialparameters(rng, l)
121-
@test ps.ϵ == [0.0f0]
121+
@test ps.ϵ == Float32[0.5]
122122

123123
@test GINConv(nn, 0.5).ϵ == 0.5
124124
end

‎GraphNeuralNetworks/src/layers/conv.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ Flux.@layer :expand GINConv
638638
Flux.trainable(l::GINConv) = l.train_eps ? (; l.nn, l.ϵ) : (; l.nn)
639639

640640
GINConv(nn, ϵ::Real; aggr = +, train_eps::Bool = false) =
641-
GINConv(nn, train_eps ? [ϵ] : ϵ, aggr, train_eps)
641+
GINConv(nn, train_eps ? Float32[ϵ] : ϵ, aggr, train_eps)
642642

643643
GINConv(nn, ϵ::Real, aggr) = GINConv(nn, ϵ; aggr)
644644

‎GraphNeuralNetworks/test/layers/conv.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ end
285285
end
286286
@test keys(Flux.trainable(l)) == (:nn,)
287287

288-
l = GINConv(Dense(D_IN, D_OUT); train_eps = true, aggr = mean)
288+
l = GINConv(Dense(D_IN, D_OUT); ϵ = 0.5, train_eps = true, aggr = mean)
289289
@test keys(Flux.trainable(l)) == (:nn, :ϵ)
290-
@test l.ϵ == [0.0f0]
290+
@test l.ϵ == Float32[0.5]
291291
for g in TEST_GRAPHS
292292
@test size(l(g, g.x)) == (D_OUT, g.num_nodes)
293293
end

0 commit comments

Comments
 (0)