(n_neurons, time)
| 33 | |
| 34 | |
| 35 | def BindsNET_cpu(n_neurons, time): |
| 36 | t0 = t() |
| 37 | |
| 38 | torch.set_default_tensor_type("torch.FloatTensor") |
| 39 | |
| 40 | t1 = t() |
| 41 | |
| 42 | network = Network() |
| 43 | network.add_layer(Input(n=n_neurons), name="X") |
| 44 | network.add_layer(LIFNodes(n=n_neurons), name="Y") |
| 45 | network.add_connection( |
| 46 | Connection(source=network.layers["X"], target=network.layers["Y"]), |
| 47 | source="X", |
| 48 | target="Y", |
| 49 | ) |
| 50 | |
| 51 | data = {"X": poisson(datum=torch.rand(n_neurons), time=time)} |
| 52 | network.run(inputs=data, time=time) |
| 53 | |
| 54 | return t() - t0, t() - t1 |
| 55 | |
| 56 | |
| 57 | def BindsNET_gpu(n_neurons, time): |
nothing calls this directly
no test coverage detected