Example #1
0
def delay_pulses_on_layer_0_and_1(net, t0s=[0., 20], i_max=50.):
    #i_max = 50. #5. # (some unit)
    # t0=50. # ms
    #dts = 10.
    w = 1. #ms
    for (i,neuron) in enumerate(net.layers[0].nodes()):
        neuron.i_inj = i_max*electrodes.unit_pulse(t,t0s[0],w) # the jitcode t
    for neuron in net.layers[1].nodes():
        neuron.i_inj = i_max*electrodes.unit_pulse(t,t0s[1],w)
Example #2
0
def get_poisson_spike_train(rates, t0=0., time_total=100., i_max=50., w=1.):
    #w = 1. #pules width ms
    i_injs = []
    trains = poisson_train(rates, time_total)
    for train in trains:
        train = train[train <= time_total]
        i_inj = sum(i_max*electrodes.unit_pulse(t,t0+t_spike,w) for t_spike in train)
        i_injs.append(i_inj)
    return i_injs, trains
Example #3
0
def pulse_on_layer(net, layer_idx, t0=50., i_max=50.):
    w = 1. #ms
    for (i,neuron) in enumerate(net.layers[layer_idx].nodes()):
        neuron.i_inj = i_max*electrodes.unit_pulse(t,t0,w) # the jitcode t
Example #4
0
def pulse_train_on_layer(net, layer_idx, t0s, i_max=50.):
    w = 1. #ms
    i_inj = i_max*sum(electrodes.unit_pulse(t,t0,w) for t0 in t0s)
    for (i,neuron) in enumerate(net.layers[layer_idx].nodes()):
        neuron.i_inj = i_inj # the jitcode t
Example #5
0
def delay_pulses_on_presyn_0_and_1(net, t0s=[0., 20], i_max=55., w=1.0):
    for (i, neuron) in enumerate(net.layers[0].nodes()):
        neuron.i_inj = i_max * electrodes.unit_pulse(t, t0s[i],
                                                     w)  # the jitcode t