MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / _make_conv

Function _make_conv

test/network/test_mstdp_florian.py:381–401  ·  view source on GitHub ↗
(conn_cls, in_shape, out_shape, rule, batch, tc=20.0)

Source from the content-addressed store, hash-verified

379
380
381def _make_conv(conn_cls, in_shape, out_shape, rule, batch, tc=20.0):
382 src = Input(shape=in_shape)
383 tgt = LIFNodes(shape=out_shape)
384 src.batch_size = batch
385 tgt.batch_size = batch
386 src.s = torch.zeros(batch, *in_shape, dtype=torch.bool)
387 tgt.s = torch.zeros(batch, *out_shape, dtype=torch.bool)
388 conn = conn_cls(
389 src,
390 tgt,
391 kernel_size=3,
392 stride=1,
393 nu=1e-2,
394 update_rule=rule,
395 tc_plus=tc,
396 tc_minus=tc,
397 )
398 conn.dt = 1.0
399 with torch.no_grad():
400 conn.w.zero_()
401 return conn
402
403
404class TestConvMSTDP:

Calls 2

InputClass · 0.90
LIFNodesClass · 0.90

Tested by

no test coverage detected