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

Method test_multidim_bernoulli

test/encoding/test_encoding.py:20–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 assert spikes.size() == torch.Size((t, n))
19
20 def test_multidim_bernoulli(self):
21 for shape in [[5, 5], [10, 10], [25, 25]]: # shape of nodes in layer
22 for t in [1, 100]: # number of timesteps
23 for m in [0.1, 1.0]: # maximum spiking probability
24 datum = torch.empty(shape).uniform_(0, m)
25 spikes = bernoulli(datum, time=t, max_prob=m)
26
27 assert spikes.size() == torch.Size((t, *shape))
28
29 def test_bernoulli_loader(self):
30 for s in [1, 100]: # number of data samples

Callers

nothing calls this directly

Calls 1

bernoulliFunction · 0.85

Tested by

no test coverage detected