Skip to content

Commit

Permalink
Merge pull request #128 from castrong/write_tests_fix
Browse files Browse the repository at this point in the history
import names in write_nnet_test so it can be run by including
  • Loading branch information
tomerarnon committed Jul 24, 2020
2 parents d66a8fc + 77f1646 commit 50e27ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/write_nnet_test.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Test by creating a network, writing it, then reading it back in and make sure that all weights and biases match
@testset "Read nnet test" begin
import NeuralVerification: Layer, ReLU, Id

@testset "Write + Read nnet test" begin

# 3 --> 3 --> 2 --> 5
l1 = Layer([3.0 2.0 1.0; 5.0 6.0 7.0; 8.0 9.0 10.0], [0.8; 1.0; 1.2], ReLU())
Expand All @@ -14,7 +16,7 @@
write_nnet(network_file, nnet; header_text="test_header")

# Read back in the network
new_nnet = NeuralVerification.read_nnet(network_file)
new_nnet = read_nnet(network_file)

# Test that all weights, biases, and activations are the same
@test new_nnet.layers[1].weights == l1.weights;
Expand Down

0 comments on commit 50e27ea

Please sign in to comment.