"Square" signal in response to spike

Hi there,

I’m trying to replicate some previous work (eg: Naud & Sprekeler 2018) that has a “square” signal in response to spiking. I had two thoughts on going about this. My first thought was to use not_refractory, but the signal needs to be delayed (“on” if 0.5ms < delta < 3ms, 0 otherwise). My second idea was to put a conditional, compared to lastspike in the derivative equation, eg:

eqsPyr = '''
...
dx/dt = (-(Cd/tau_x)*(x-El) + (gd / (1+exp(-(x-Ed)/Dd))) + gc*( ((t-lastspike)< (3*ms)) * ((t-lastspike)>0.5)) : 
'''

However, it seems like 1) ‘lastspike’ isn’t known within the update space, and 2) comparisons (<) can’t be made in this space either.

Does anyone have any thoughts on how I might implement this square signal?

Thanks!

Hi @wchapman,
this is great use for “synaptic pathways” (i.e. separate actions for the same pre-synaptic event which can also have different delays). The first pathway will make things “go up”, and the second, delayed pathway will make things “go down” again. See the example at the end of the documentation for synaptic pathways.
If I understand correctly, you want to use this for the membrane potential of a neuron itself (e.g. as a crude model of an action potential in an I&F model) instead of as a model of a synaptic current. In that case, you’d have to use “fake” synapses to connect each neurons to itself. These synapses would basically replace the usual reset mechanism.
I think you could solve it with the refractory mechanism as well, though, but it would be less efficient/clean. I’d have to take a closer look, though.

Hope that helps, best
Marcel

Marcel,

Thanks for your reply. I’d not seen the synaptic pathways section before, but that ended up being an easy solution. I added a property (bac) to the model and added the pathway:

    pyr_bac_rule = {'up': 'bac=1',
                    'down': 'bac=0'}
    pyr_bac_del = {'up': 0.5 * ms, 'down': 3.0 * ms}

    s_pyr_bac = Synapses(p, p, on_pre=pyr_bac_rule, delay=pyr_bac_del)
    s_pyr_bac.connect(j='i') 

Thanks!
– William

1 Like