Description of problem
I’ve been probing online tutorial from 2020 youtube footage. I am aware of the github solution. But I want to execute it step by step as explained in the slide to learn more precisely. So there are some steps I achieved, for the fourth step I defined inh population to the network. Based on the slide I am not sure that I should have sustained activity. What are your thoughts? Thanks.
Minimal code to reproduce problem
tau = 10*ms
# Noise strength
sigma_noise = 0.5
# stimulus parameters
theta_stim = 0.
# stimulus sensitivity
sigma_theta = pi/8
# Number of neurons
N_E = 400
N_I = 100
# Define the time-varying amp_stim values
amp_stim = TimedArray([1., 0.], dt=1000*ms)
# excitatory neurons
exc_neurons = NeuronGroup(N_E, '''dv/dt = (-v + I_stim)/tau + sigma_noise*xi*tau**-0.5: 1
theta : 1 (constant)
stimulus_diff = (theta - theta_stim + pi)%(2*pi) - pi : radian
I_stim = amp_stim(t) * exp(-stimulus_diff**2 / (2*sigma_theta)**2) : 1
''', threshold='v>1', reset='v=0', method='euler')
# inhibitory neurons
inh_neurons = NeuronGroup(N_I, '''dv/dt = (-v + I_syn)/tau + sigma_noise*xi*tau**-0.5: 1
I_syn: 1
''', threshold='v>1', reset='v=0', method='euler')
# Initialize the membrane potential randomly
exc_neurons.v = 'rand()*0.5'
inh_neurons.v = 'rand()*0.5'
# Uniformly distribute preferred stimuli between -pi and pi
exc_neurons.theta = '-pi + 2*pi*i/N_E'
# Creating synaptic connections
# Ext to Ext connections
E_to_E = Synapses(exc_neurons, exc_neurons, 'w : 1', on_pre='v += w')
E_to_E.connect(condition='i!=j', p='exp(-(i-j)**2/15.0**2)')
E_to_E.w = 0.04
# Ext to Inh connections
E_to_I = Synapses(exc_neurons, inh_neurons, 'w : 1', on_pre='v += w')
E_to_I.connect(p=0.5)
E_to_I.w = 1
# Inh to Inh connections
I_to_I = Synapses(inh_neurons, inh_neurons, 'w : 1', on_pre='v -= w')
I_to_I.connect(condition='i!=j')
I_to_I.w = 2
# Inh to Ext connections
I_to_E = Synapses(inh_neurons, exc_neurons, 'w : 1', on_pre='v -= w')
I_to_E.connect(condition='i!=j', p='exp(-(i-j)**2/15.0**2)')
I_to_E.w = 1
# Monitor neurons
exc_mon = SpikeMonitor(exc_neurons)
# run simulation
run(2000*ms, report='text')
![Ekran Alıntısı|690x496](upload://mrebTz3q4LunWzzlasvrYbwMOo4.jpeg)
# Plot results
fig, ax = plt.subplots()
ax.plot(exc_mon.t/ms, exc_neurons.theta[exc_mon.i], '|')
ax.set(ylabel='preferred stim', xlabel='time (ms)')
What you have aready tried
I’ve tried to adjust weights, some parameters and number of neurons.
Expected output (if relevant)
Not sure having a sustained activity.
Actual output (if relevant)
Slides
● Switch off the stimulus after the end of the simulation and continue the simulation (Done)
● Connect the neurons among each other with synapses. Can you get sustained activity after the stimulus switches off? (Done)
● Instead of connecting all neurons to all other neurons, connect them preferrably (or with stronger weights) to neurons with similar stimulus preference. (Done)
● Introduce an inhibitory population and connect it to the excitatory population (Failed)
● Add a second stimulus or change the stimulus over time (Not tried)