Hello,
Thank you @mstimberg for the Brain2 tutorial projects yesterday !
I was trying to do the project on sustained activity, based on the code here: https://github.com/brian-team/brian-material/blob/master/2020-08-Brian-online-tutorial/project/project_start.ipynb.
I’d like to know if this approach for creating excitatory and inhibitory populations is ok:
tau = 10*ms # Membrane time constant of the neuron
sigma_noise = 0.5 # Noise strength
sigma_theta = pi/8 # stimulus sensitivity
N_E = 200 # number of excitatory neurons
N_I = 200 # number of inhibitory neurons
eqs = '''
dv/dt = (-v + I_stim)/tau + sigma_noise*xi*tau**-0.5: 1
theta : 1 (constant)
theta_stim: 1
amp_stim: 1
stimulus_diff = (theta - theta_stim + pi)%(2*pi) - pi : radian
I_stim = amp_stim*exp(-stimulus_diff**2/(2*sigma_theta)**2) : 1
'''
neurons = NeuronGroup(N_E+N_I, eqs, threshold='v>1', reset='v=0', method='euler')
neurons.v = 'rand()*0.5'
exc_neurons = neurons[:N_E]
inh_neurons = neurons[N_E:]
exc_neurons.theta_stim = 0
exc_neurons.amp_stim = 2
exc_neurons.theta = '-pi + 2*pi*i/N_E'
# inhibitory neurones are just like excitatory but don't receive stimulation
inh_neurons.amp_stim = 0
# general synapses (are all excitatory)
S = Synapses(neurons, neurons, 'w:1', on_pre="v+=w")
# synapses of the excitatory pop
exc_S = Synapses(exc_neurons, exc_neurons, 'w:1', on_pre="v+=w")
# synapses of the inhibitory pop decrease v of the excitatory pop
inh_S = Synapses(inh_neurons, exc_neurons, 'w:1', on_pre="v-=w")
S.connect(p=0.1, condition="i!=j") # general synapses
# excitatory synapses are preferentially connected with those of similar sensitivity
exc_S.connect(p="0.3*exp(-((theta_pre-theta_post+pi)%(2*pi)-pi)**2/(pi/4)**2)", condition="i!=j")
# neurones in the inhibitory pop connect with the excitatory pop
inh_S.connect(p=0.5)
# all synapses have a fixed weight
S.w = 0.02
Thank you for your help!