(self, thresh=0.5, tau=0.25, gamma=1.0)
| 52 | |
| 53 | class LIFSpike(nn.Module): |
| 54 | def __init__(self, thresh=0.5, tau=0.25, gamma=1.0): |
| 55 | super(LIFSpike, self).__init__() |
| 56 | self.thresh = thresh |
| 57 | self.tau = tau |
| 58 | self.gamma = gamma |
| 59 | |
| 60 | def forward(self, x): |
| 61 | mem = torch.zeros_like(x[:, 0]) |