Skip to content

Commit 1880f8d

Browse files
committed
fix lif model bugs and support two kinds of spike reset: soft and hard
1 parent 934c676 commit 1880f8d

File tree

2 files changed

+129
-58
lines changed

2 files changed

+129
-58
lines changed

brainpy/_src/dyn/neurons/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(
2929

3030
spk_fun: Callable = bm.surrogate.InvSquareGrad(),
3131
spk_type: Any = None,
32+
spk_reset: str = 'soft',
3233
detach_spk: bool = False,
3334
):
3435
super().__init__(size=size,
@@ -38,6 +39,7 @@ def __init__(
3839
sharding=sharding,
3940
method=method)
4041

42+
self.spk_reset = spk_reset
4143
self.spk_fun = is_callable(spk_fun)
4244
self.detach_spk = detach_spk
4345
self._spk_type = spk_type

0 commit comments

Comments
 (0)