diff options
| author | Tanner Robison <[email protected]> | 2026-06-17 18:14:20 -0700 |
|---|---|---|
| committer | Tanner Robison <[email protected]> | 2026-06-17 22:05:02 -0700 |
| commit | 3b87b8bd271ade1622149516ae14f94b7ff20dd5 (patch) | |
| tree | a715ff83c167238b6152fd380cdfa5cf1086d70f /neurobench_testing/examples/gsc/SNN.py | |
| parent | 190b63c9e25770a52f9b93f4a6267c2bc21c3cfc (diff) | |
neurobench & memtorch
Diffstat (limited to 'neurobench_testing/examples/gsc/SNN.py')
| -rw-r--r-- | neurobench_testing/examples/gsc/SNN.py | 17 |
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 |
