(lc, in_shape, out_shape, rule, batch)
| 268 | |
| 269 | |
| 270 | def _make_local(lc, in_shape, out_shape, rule, batch): |
| 271 | src = Input(shape=in_shape) |
| 272 | tgt = LIFNodes(shape=out_shape) |
| 273 | src.batch_size = batch |
| 274 | tgt.batch_size = batch |
| 275 | src.s = torch.zeros(batch, *in_shape, dtype=torch.bool) |
| 276 | tgt.s = torch.zeros(batch, *out_shape, dtype=torch.bool) |
| 277 | conn = lc( |
| 278 | src, |
| 279 | tgt, |
| 280 | kernel_size=3, |
| 281 | stride=1, |
| 282 | n_filters=4, |
| 283 | nu=1e-2, |
| 284 | update_rule=rule, |
| 285 | reduction=torch.sum, |
| 286 | ) |
| 287 | conn.dt = 1.0 |
| 288 | with torch.no_grad(): |
| 289 | conn.w.zero_() |
| 290 | return conn |
| 291 | |
| 292 | |
| 293 | class TestLocalMSTDPET: |
no test coverage detected