def show(title, a, b, c, d): n = Neuron(0.0, a, b, c, d) spike_train = [] for i in range(1000): n.current = 0.0 if i < 100 or i > 800 else 10.0 spike_train.append((1.0 * i, n.current, n.v, n.u)) print('{0:d}\t{1:f}\t{2:f}\t{3:f}'.format(i, n.current, n.v, n.u)) n.advance() visualize.plot_spikes(spike_train, view=False, title=title)
def test_network(): neurons = {0: Neuron(0, 0.02, 0.2, -65.0, 8.0), 1: Neuron(0, 0.02, 0.2, -65.0, 8.0), 2: Neuron(0, 0.02, 0.2, -65.0, 8.0)} inputs = [0, 1] outputs = [2] connections = [(0, 2, 0.123), (1, 2, 0.234)] net = IzNetwork(neurons, inputs, outputs, connections) net.set_inputs([1.0, 0.0]) net.advance() net.advance()
def test_basic(): n = Neuron(10, 0.02, 0.2, -65.0, 8.0) spike_train = [] for i in range(1000): spike_train.append(n.v) n.advance()