Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…rks.jl into nn-lux
  • Loading branch information
rbSparky committed Aug 19, 2024
2 parents 93affd2 + f2ff073 commit 3547d9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GNNLux/test/layers/basic_tests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testitem "layers/basic" setup=[SharedTestSetup] begin
rng = StableRNG(17)
g = rand_graph(10, 40)
g = rand_graph(rng, 10, 40)
x = randn(rng, Float32, 3, 10)

@testset "GNNLayer" begin
Expand Down
10 changes: 6 additions & 4 deletions GNNLux/test/layers/conv_tests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@testitem "layers/conv" setup=[SharedTestSetup] begin
rng = StableRNG(1234)
edims = 10
g = GNNGraph(g, edata = rand(Float32, edim, g.num_edges))
edim = 10
g = rand_graph(rng, 10, 40)
in_dims = 3
out_dims = 5
x = randn(rng, Float32, in_dims, 10)

g2 = GNNGraph(g, edata = rand(Float32, edim, g.num_edges))

@testset "GCNConv" begin
l = GCNConv(in_dims => out_dims, tanh)
test_lux_layer(rng, l, g, x, outputsize=(out_dims,))
Expand Down Expand Up @@ -97,8 +99,8 @@

@testset "NNConv" begin
edim = 10
nn = Dense(edim, out_dims * in_dims)
nn = Dense(edim, out_dims * in_dims)
l = NNConv(in_dims => out_dims, nn, tanh, aggr = +)
test_lux_layer(rng, l, g, x, sizey=(out_dims, g.num_nodes), container=true)
test_lux_layer(rng, l, g2, x, sizey=(out_dims, g2.num_nodes), container=true, edge_weight=g2.edata.e)
end
end

0 comments on commit 3547d9f

Please sign in to comment.