summaryrefslogtreecommitdiff
path: root/neurobench_testing/examples/gsc/SNN.py
diff options
context:
space:
mode:
Diffstat (limited to 'neurobench_testing/examples/gsc/SNN.py')
-rw-r--r--neurobench_testing/examples/gsc/SNN.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/neurobench_testing/examples/gsc/SNN.py b/neurobench_testing/examples/gsc/SNN.py
new file mode 100644
index 0000000..1642e28
--- /dev/null
+++ b/neurobench_testing/examples/gsc/SNN.py
@@ -0,0 +1,17 @@
+from torch import nn
+import snntorch as snn
+from snntorch import surrogate
+
+beta = 0.9
+spike_grad = surrogate.fast_sigmoid()
+net = nn.Sequential(
+ nn.Flatten(),
+ nn.Linear(20, 256),
+ snn.Leaky(beta=beta, spike_grad=spike_grad, init_hidden=True),
+ nn.Linear(256, 256),
+ snn.Leaky(beta=beta, spike_grad=spike_grad, init_hidden=True),
+ nn.Linear(256, 256),
+ snn.Leaky(beta=beta, spike_grad=spike_grad, init_hidden=True),
+ nn.Linear(256, 35),
+ snn.Leaky(beta=beta, spike_grad=spike_grad, init_hidden=True, output=True),
+) \ No newline at end of file