Hello BRIAN community,
I am trying to encode a raw data with change in Millivolts (mv) using LIF neuron (for example 1.85056351567864, 1.8491182453731, 1.84852311981119, 1.84873827962888,…). The membrane potential of the neuron is always increasing (depolarizing) and is not detecting the dynamics (change in frequencies, amplitude) of the injected raw signal.
Can anyone tell me what’s the reason behind this ?
Thank you.
Hi @Haydar. Could you give some more details of what your neuron model looks like, how you inject the current, etc.?
f1 = pd.read_csv('trial.csv')
f1 = np.array(f1)
I_recorder1=TimedArray((f1)*nA,dt= 1*ms)
tau = 10*ms;
E1 = -70*mV;
defaultclock.dt = 1*ms;
R1 = 17*kohm; # (considering this as a hyperparameter won't help)
eqs1 = '''dv/dt = ((E1-v)+R1*I_recorder1(t,i))/tau : volt (unless refractory)
'''
G1 = NeuronGroup(8, eqs1, threshold= 'v>-60*mV' , reset= 'v = -70*mV' ,refractory=1*ms, method='exact')
G1.v=-70*mV
S1 = SpikeMonitor(G1)
run(1000*ms)
plot(S1.t/ms, S1.i, '.r')
This is the code I am using , the numpy array (f1) carries out the raw data that I mentioned in the first post (consist of 8 columns and 1000 rows )., and I am injecting it as I_recorder(t,i) in the eqs1.
Hi again, thanks for the code. I don’t see anything wrong with the code in general, but make sure that the array has indeed shape 1000 × 8 and not the opposite. I ran it by replacing the input current f1
by:
f1 = np.vstack([np.arange(1000), np.arange(1000)[::-1]]).T
i.e. with an increasing current from 0 to 1000nA for one neuron, and 1000nA to 0 for the other neuron. The result looks reasonable:
In your initial post, you wrote your values are in mV, but in your code you give values in nA (which gets multiplied with R1 in the equations). Values on the order of 1.8nA would be much too weak to elicit any spiking (spiking starts around 600nA input current in this model). Can you give more information on what your input is and what your output looks like?
Just to make sure there is no misunderstanding: for simplicity, I changed your example so that it has 2 instead of 8 neurons (and my input therefore has only 2 columns as well).
@mstimberg thank you so much the problem was related to the data itself. Best regards,