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

Method test_conv_learns

test/network/test_mstdp_florian.py:458–466  ·  view source on GitHub ↗
(self, dim, conn_cls, in_shape, out_shape, rule)

Source from the content-addressed store, hash-verified

456 @pytest.mark.parametrize("dim,conn_cls,in_shape,out_shape", _CONV_CASES)
457 @pytest.mark.parametrize("rule", [MSTDP, MSTDPET])
458 def test_conv_learns(self, dim, conn_cls, in_shape, out_shape, rule):
459 torch.manual_seed(2)
460 T = 25
461 pre = torch.bernoulli(torch.full((T, 1, *in_shape), 0.3))
462 post = torch.bernoulli(torch.full((T, 1, *out_shape), 0.3))
463 dW, _ = _drive_shaped(
464 _make_conv(conn_cls, in_shape, out_shape, rule, 1), pre, post
465 )
466 assert dW.abs().sum().item() > 0.0
467
468 @pytest.mark.parametrize("dim,conn_cls,in_shape,out_shape", _CONV_CASES)
469 @pytest.mark.parametrize("rule", [MSTDP, MSTDPET])

Callers

nothing calls this directly

Calls 2

_drive_shapedFunction · 0.85
_make_convFunction · 0.85

Tested by

no test coverage detected