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

Function _make_local

test/network/test_mstdp_florian.py:270–290  ·  view source on GitHub ↗
(lc, in_shape, out_shape, rule, batch)

Source from the content-addressed store, hash-verified

268
269
270def _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
293class TestLocalMSTDPET:

Calls 2

InputClass · 0.90
LIFNodesClass · 0.90

Tested by

no test coverage detected