From dd8d8b1d1ab81be8cc9aeed56b9d88d4655d9169 Mon Sep 17 00:00:00 2001 From: genema Date: Tue, 15 Aug 2023 13:14:26 +0800 Subject: [PATCH] noisylif module tests --- tests/test_snntorch/test_noisyleaky.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_snntorch/test_noisyleaky.py b/tests/test_snntorch/test_noisyleaky.py index c2523714..6fa958e4 100644 --- a/tests/test_snntorch/test_noisyleaky.py +++ b/tests/test_snntorch/test_noisyleaky.py @@ -63,7 +63,9 @@ def test_noisyleaky(self, noisyleaky_instance, input_): spk_rec.append(spk) assert mem_rec[1] == mem_rec[0] * 0.5 + input_[1] - assert spk_rec[0] == spk_rec[1] + # The firing mechanism is probabilistic and cannot guarantee that the spike output will be + # the same. + # assert spk_rec[0] == spk_rec[1] def test_noisyleaky_reset( self, @@ -96,8 +98,9 @@ def test_noisyleaky_init_hidden( for i in range(2): spk = noisyleaky_hidden_instance(input_[i]) spk_rec.append(spk) - - assert spk_rec[0] == spk_rec[1] + # The firing mechanism is probabilistic and cannot guarantee that the spike output will be + # the same. + # assert spk_rec[0] == spk_rec[1] def test_noisyleaky_init_hidden_reset_zero( self, noisyleaky_hidden_reset_zero_instance, input_ @@ -108,8 +111,9 @@ def test_noisyleaky_init_hidden_reset_zero( for i in range(2): spk = noisyleaky_hidden_reset_zero_instance(input_[i]) spk_rec.append(spk) - - assert spk_rec[0] == spk_rec[1] + # The firing mechanism is probabilistic and cannot guarantee that the spike output will be + # the same. + # assert spk_rec[0] == spk_rec[1] def test_noisyleaky_init_hidden_reset_none( self, noisyleaky_hidden_reset_none_instance, input_ @@ -121,7 +125,9 @@ def test_noisyleaky_init_hidden_reset_none( spk = noisyleaky_hidden_reset_none_instance(input_[i]) spk_rec.append(spk) - assert spk_rec[0] == spk_rec[1] + # The firing mechanism is probabilistic and cannot guarantee that the spike output will be + # the same. + # assert spk_rec[0] == spk_rec[1] def test_noisyleaky_cases(self, noisyleaky_hidden_instance, input_): with pytest.raises(TypeError):