示例#1
0
    def init_connectivity(self):
        # Init connections from contralaterally tuned neurons in the opposite
        # hemisphere to ipsilaterally tuned neurons in this hemisphere
        left_ec_vis_ei_vis_ampa=init_connection(self.right_lip.e_contra_vis, self.left_lip.e_ipsi_vis, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_vis_ei_vis, delay=20*ms)
        #left_ec_ei_nmda=DelayConnection(self.right_lip.e_contra, self.left_lip.e_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ei, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(left_ec_vis_ei_vis_ampa)
        #self.connections.append(left_ec_ei_nmda)

        left_ec_mem_ei_mem_ampa=init_connection(self.right_lip.e_contra_mem, self.left_lip.e_ipsi_mem, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_mem_ei_mem, delay=20*ms)
        self.connections.append(left_ec_mem_ei_mem_ampa)


        # Init connections from contralaterally tuned pyramidal cells in the opposite
        # hemisphere to ipsilaterally tuned interneurons in this hemisphere
        left_ec_ii_ampa=init_connection(self.right_lip.e_contra, self.left_lip.i_ipsi, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_ii, delay=20*ms)
        #left_ec_ii_nmda=DelayConnection(self.right_lip.e_contra, self.left_lip.i_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ii, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(left_ec_ii_ampa)
        #self.connections.append(left_ec_ii_nmda)

        # Init connections from contralaterally tuned neurons in the opposite
        # hemisphere to ipsilaterally tuned neurons in this hemisphere
        right_ec_vis_ei_vis_ampa=init_connection(self.left_lip.e_contra_vis, self.right_lip.e_ipsi_vis, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_vis_ei_vis, delay=20*ms)
        #right_ec_ei_nmda=DelayConnection(self.left_lip.e_contra, self.right_lip.e_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ei, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(right_ec_vis_ei_vis_ampa)
        #self.connections.append(right_ec_ei_nmda)

        right_ec_mem_ei_mem_ampa=init_connection(self.left_lip.e_contra_mem, self.right_lip.e_ipsi_mem, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_mem_ei_mem, delay=20*ms)
        self.connections.append(right_ec_mem_ei_mem_ampa)

        # Init connections from contralaterally tuned pyramidal cells in the opposite
        # hemisphere to ipsilaterally tuned interneurons in this hemisphere
        right_ec_ii_ampa=init_connection(self.left_lip.e_contra, self.right_lip.i_ipsi, 'g_ampa_r',
            self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_ec_ii, delay=20*ms)
        #right_ec_ii_nmda=DelayConnection(self.left_lip.e_contra, self.right_lip.i_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ii, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(right_ec_ii_ampa)
        #self.connections.append(right_ec_ii_nmda)

        self.connections.extend(self.left_lip.connections)
        self.connections.extend(self.right_lip.connections)
示例#2
0
    def init_connectivity(self, clock):
        self.connections = {}
        self.stdp = {}

        # Iterate over input groups
        for i in range(self.params.num_groups):

            # E population - recurrent connections
            self.connections['e%d->e%d_ampa' % (i, i)] = init_connection(
                self.groups_e[i],
                self.groups_e[i],
                'g_ampa_r',
                self.pyr_params.w_ampa_rec,
                self.params.p_e_e,
                delay=.5 * ms,
                allow_self_conn=False)
            self.connections['e%d->e%d_nmda' % (i, i)] = init_connection(
                self.groups_e[i],
                self.groups_e[i],
                'g_nmda',
                self.pyr_params.w_nmda,
                self.params.p_e_e,
                delay=.5 * ms,
                allow_self_conn=False)

        # E -> I excitatory connections
        self.connections['e->i_ampa'] = init_connection(
            self.group_e,
            self.group_i,
            'g_ampa_r',
            self.inh_params.w_ampa_rec,
            self.params.p_e_i,
            delay=.5 * ms)
        self.connections['e->i_nmda'] = init_connection(self.group_e,
                                                        self.group_i,
                                                        'g_nmda',
                                                        self.inh_params.w_nmda,
                                                        self.params.p_e_i,
                                                        delay=.5 * ms)

        # I -> E - inhibitory connections
        self.connections['i->e_gabaa'] = init_connection(
            self.group_i,
            self.group_e,
            'g_gaba_a',
            self.pyr_params.w_gaba,
            self.params.p_i_e,
            delay=.5 * ms)

        # I population - recurrent connections
        self.connections['i->i_gabaa'] = init_connection(
            self.group_i,
            self.group_i,
            'g_gaba_a',
            self.inh_params.w_gaba,
            self.params.p_i_i,
            delay=.5 * ms,
            allow_self_conn=False)

        if self.background_input is not None:
            # Background -> E+I population connections
            self.connections['b->ampa'] = DelayConnection(
                self.background_input, self, 'g_ampa_b', delay=.5 * ms)
            self.connections['b->ampa'][:, :] = 0
            for i in xrange(len(self.background_input)):
                if i < self.e_size:
                    self.connections['b->ampa'][i,
                                                i] = self.pyr_params.w_ampa_bak
                else:
                    self.connections['b->ampa'][i,
                                                i] = self.inh_params.w_ampa_bak

        if self.task_inputs is not None:
            # Task input -> E population connections
            for i in range(self.params.num_groups):
                self.connections['t%d->e%d_ampa' % (i, i)] = DelayConnection(
                    self.task_inputs[i], self.groups_e[i], 'g_ampa_x')
                self.connections['t%d->e%d_ampa' % (i, i)].connect_one_to_one(
                    weight=self.pyr_params.w_ampa_ext_correct, delay=.5 * ms)
                self.connections['t%d->e%d_ampa' %
                                 (i, 1 - i)] = DelayConnection(
                                     self.task_inputs[i], self.groups_e[1 - i],
                                     'g_ampa_x')
                self.connections[
                    't%d->e%d_ampa' % (i, 1 - i)].connect_one_to_one(
                        weight=self.pyr_params.w_ampa_ext_incorrect,
                        delay=.5 * ms)

                # Input projections plasticity
                self.stdp['stdp%d_%d' % (i, i)] = ExponentialSTDP(
                    self.connections['t%d->e%d_ampa' % (i, i)],
                    self.plasticity_params.tau_pre,
                    self.plasticity_params.tau_post,
                    self.plasticity_params.dA_pre,
                    self.plasticity_params.dA_post,
                    wmax=self.plasticity_params.gmax,
                    update='additive',
                    clock=clock)
                self.stdp['stdp%d_%d' % (i, 1 - i)] = ExponentialSTDP(
                    self.connections['t%d->e%d_ampa' % (i, 1 - i)],
                    self.plasticity_params.tau_pre,
                    self.plasticity_params.tau_post,
                    self.plasticity_params.dA_pre,
                    self.plasticity_params.dA_post,
                    wmax=self.plasticity_params.gmax,
                    update='additive',
                    clock=clock)
示例#3
0
    def init_connectivity(self):
        # Init connections from contralaterally tuned pyramidal cells to other
        # contralaterally tuned pyramidal cells in the same hemisphere
        self.connections.append(
            init_connection(self.e_contra_mem,
                            self.e_contra_mem,
                            'g_ampa_r',
                            self.params.w_ampa_min,
                            self.params.w_ampa_max,
                            self.params.p_ec_mem_ec_mem,
                            delay=5 * ms,
                            allow_self_conn=False))
        self.connections.append(
            init_connection(self.e_contra_mem,
                            self.e_contra_mem,
                            'g_nmda',
                            self.params.w_nmda_min,
                            self.params.w_nmda_max,
                            self.params.p_ec_mem_ec_mem,
                            delay=5 * ms,
                            allow_self_conn=False))

        self.connections.append(
            init_connection(self.e_contra_vis,
                            self.e_contra_vis,
                            'g_ampa_r',
                            self.params.w_ampa_min,
                            self.params.w_ampa_max,
                            self.params.p_ec_vis_ec_vis,
                            delay=5 * ms,
                            allow_self_conn=False))
        self.connections.append(
            init_connection(self.e_contra_vis,
                            self.e_contra_vis,
                            'g_nmda',
                            self.params.w_nmda_min,
                            self.params.w_nmda_max,
                            self.params.p_ec_vis_ec_vis,
                            delay=5 * ms,
                            allow_self_conn=False))

        ec_vis_ec_mem_ampa = init_connection(self.e_contra_vis,
                                             self.e_contra_mem,
                                             'g_ampa_r',
                                             self.params.w_ampa_min,
                                             self.params.w_ampa_max,
                                             self.params.p_ec_vis_ec_mem,
                                             delay=5 * ms)
        ec_vis_ec_mem_nmda = init_connection(self.e_contra_vis,
                                             self.e_contra_mem,
                                             'g_nmda',
                                             self.params.w_nmda_min,
                                             self.params.w_nmda_max,
                                             self.params.p_ec_vis_ec_mem,
                                             delay=5 * ms)
        self.connections.append(ec_vis_ec_mem_ampa)
        self.connections.append(ec_vis_ec_mem_nmda)

        # Init connections from ipsilaterally tuned interneurons to contralaterally
        # tuned pyramidal cells in the same hemisphere
        ii_ec_gabaa = init_connection(self.i_ipsi,
                                      self.e_contra,
                                      'g_gaba_a',
                                      self.params.w_gaba_a_min,
                                      self.params.w_gaba_a_max,
                                      self.params.p_ii_ec,
                                      delay=5 * ms)
        ii_ec_gabab = init_connection(self.i_ipsi,
                                      self.e_contra,
                                      'g_gaba_b',
                                      self.params.w_gaba_b_min,
                                      self.params.w_gaba_b_max,
                                      self.params.p_ii_ec,
                                      delay=5 * ms)
        self.connections.append(ii_ec_gabaa)
        self.connections.append(ii_ec_gabab)

        # Init connections from ipsilaterally tuned pyramidal cells to other
        # ipsilaterally tuned pyramidal cells in the same hemisphere
        self.connections.append(
            init_connection(self.e_ipsi_mem,
                            self.e_ipsi_mem,
                            'g_ampa_r',
                            self.params.w_ampa_min,
                            self.params.w_ampa_max,
                            self.params.p_ei_mem_ei_mem,
                            delay=5 * ms,
                            allow_self_conn=False))
        self.connections.append(
            init_connection(self.e_ipsi_mem,
                            self.e_ipsi_mem,
                            'g_nmda',
                            self.params.w_nmda_min,
                            self.params.w_nmda_max,
                            self.params.p_ei_mem_ei_mem,
                            delay=5 * ms,
                            allow_self_conn=False))

        self.connections.append(
            init_connection(self.e_ipsi_vis,
                            self.e_ipsi_vis,
                            'g_ampa_r',
                            self.params.w_ampa_min,
                            self.params.w_ampa_max,
                            self.params.p_ei_vis_ei_vis,
                            delay=5 * ms,
                            allow_self_conn=False))
        self.connections.append(
            init_connection(self.e_ipsi_vis,
                            self.e_ipsi_vis,
                            'g_nmda',
                            self.params.w_nmda_min,
                            self.params.w_nmda_max,
                            self.params.p_ei_vis_ei_vis,
                            delay=5 * ms,
                            allow_self_conn=False))

        ei_vis_ei_mem_ampa = init_connection(self.e_ipsi_vis,
                                             self.e_ipsi_mem,
                                             'g_ampa_r',
                                             self.params.w_ampa_min,
                                             self.params.w_ampa_max,
                                             self.params.p_ei_vis_ei_mem,
                                             delay=5 * ms)
        ei_vis_ei_mem_nmda = init_connection(self.e_ipsi_vis,
                                             self.e_ipsi_mem,
                                             'g_nmda',
                                             self.params.w_nmda_min,
                                             self.params.w_nmda_max,
                                             self.params.p_ei_vis_ei_mem,
                                             delay=5 * ms)
        self.connections.append(ei_vis_ei_mem_ampa)
        self.connections.append(ei_vis_ei_mem_nmda)

        # Init connections from contralaterally tuned interneurons to ipsilaterally
        # tuned pyramidal cells in the same hemisphere
        ic_ei_gabaa = init_connection(self.i_contra,
                                      self.e_ipsi,
                                      'g_gaba_a',
                                      self.params.w_gaba_a_min,
                                      self.params.w_gaba_a_max,
                                      self.params.p_ic_ei,
                                      delay=5 * ms)
        ic_ei_gabab = init_connection(self.i_contra,
                                      self.e_ipsi,
                                      'g_gaba_b',
                                      self.params.w_gaba_b_min,
                                      self.params.w_gaba_b_max,
                                      self.params.p_ic_ei,
                                      delay=5 * ms)
        self.connections.append(ic_ei_gabaa)
        self.connections.append(ic_ei_gabab)

        # Init connections from ipsilaterally tuned pyramidal cells to ipsilaterally
        # tuned interneurons in the same hemisphere
        ei_ii_ampa = init_connection(self.e_ipsi,
                                     self.i_ipsi,
                                     'g_ampa_r',
                                     self.params.w_ampa_min,
                                     self.params.w_ampa_max,
                                     self.params.p_ei_ii,
                                     delay=5 * ms)
        #ei_ii_nmda=DelayConnection(self.e_ipsi, self.i_ipsi, 'g_nmda', sparseness=self.params.p_ei_ii,
        #    weight=self.params.w_nmda_max, delay=delay=5*ms)
        #ei_ii_nmda=process_connection(ei_ii_nmda, self.e_ipsi, self.i_ipsi, self.params.w_nmda_min,
        #    self.params.w_nmda_max)
        self.connections.append(ei_ii_ampa)
        #self.connections.append(ei_ii_nmda)

        # Init connections from contralaterally tuned pyramidal cells to
        # contralaterally tuned interneurons in the same hemisphere
        ec_ic_ampa = init_connection(self.e_contra,
                                     self.i_contra,
                                     'g_ampa_r',
                                     self.params.w_ampa_min,
                                     self.params.w_ampa_max,
                                     self.params.p_ec_ic,
                                     delay=5 * ms)
        #ec_ic_nmda=DelayConnection(self.e_contra, self.i_contra, 'g_nmda', sparseness=self.params.p_ec_ic,
        #    weight=self.params.w_nmda_max, delay=delay=5*ms)
        #ec_ic_nmda=process_connection(ec_ic_nmda, self.e_contra, self.i_contra, self.params.w_nmda_min,
        #    self.params.w_nmda_max)
        self.connections.append(ec_ic_ampa)
示例#4
0
    def init_connectivity(self):
        # Init connections from contralaterally tuned neurons in the opposite
        # hemisphere to ipsilaterally tuned neurons in this hemisphere
        left_ec_vis_ei_vis_ampa = init_connection(self.right_lip.e_contra_vis,
                                                  self.left_lip.e_ipsi_vis,
                                                  'g_ampa_r',
                                                  self.params.w_ampa_min,
                                                  self.params.w_ampa_max,
                                                  self.params.p_ec_vis_ei_vis,
                                                  delay=20 * ms)
        #left_ec_ei_nmda=DelayConnection(self.right_lip.e_contra, self.left_lip.e_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ei, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(left_ec_vis_ei_vis_ampa)
        #self.connections.append(left_ec_ei_nmda)

        left_ec_mem_ei_mem_ampa = init_connection(self.right_lip.e_contra_mem,
                                                  self.left_lip.e_ipsi_mem,
                                                  'g_ampa_r',
                                                  self.params.w_ampa_min,
                                                  self.params.w_ampa_max,
                                                  self.params.p_ec_mem_ei_mem,
                                                  delay=20 * ms)
        self.connections.append(left_ec_mem_ei_mem_ampa)

        # Init connections from contralaterally tuned pyramidal cells in the opposite
        # hemisphere to ipsilaterally tuned interneurons in this hemisphere
        left_ec_ii_ampa = init_connection(self.right_lip.e_contra,
                                          self.left_lip.i_ipsi,
                                          'g_ampa_r',
                                          self.params.w_ampa_min,
                                          self.params.w_ampa_max,
                                          self.params.p_ec_ii,
                                          delay=20 * ms)
        #left_ec_ii_nmda=DelayConnection(self.right_lip.e_contra, self.left_lip.i_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ii, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(left_ec_ii_ampa)
        #self.connections.append(left_ec_ii_nmda)

        # Init connections from contralaterally tuned neurons in the opposite
        # hemisphere to ipsilaterally tuned neurons in this hemisphere
        right_ec_vis_ei_vis_ampa = init_connection(self.left_lip.e_contra_vis,
                                                   self.right_lip.e_ipsi_vis,
                                                   'g_ampa_r',
                                                   self.params.w_ampa_min,
                                                   self.params.w_ampa_max,
                                                   self.params.p_ec_vis_ei_vis,
                                                   delay=20 * ms)
        #right_ec_ei_nmda=DelayConnection(self.left_lip.e_contra, self.right_lip.e_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ei, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(right_ec_vis_ei_vis_ampa)
        #self.connections.append(right_ec_ei_nmda)

        right_ec_mem_ei_mem_ampa = init_connection(self.left_lip.e_contra_mem,
                                                   self.right_lip.e_ipsi_mem,
                                                   'g_ampa_r',
                                                   self.params.w_ampa_min,
                                                   self.params.w_ampa_max,
                                                   self.params.p_ec_mem_ei_mem,
                                                   delay=20 * ms)
        self.connections.append(right_ec_mem_ei_mem_ampa)

        # Init connections from contralaterally tuned pyramidal cells in the opposite
        # hemisphere to ipsilaterally tuned interneurons in this hemisphere
        right_ec_ii_ampa = init_connection(self.left_lip.e_contra,
                                           self.right_lip.i_ipsi,
                                           'g_ampa_r',
                                           self.params.w_ampa_min,
                                           self.params.w_ampa_max,
                                           self.params.p_ec_ii,
                                           delay=20 * ms)
        #right_ec_ii_nmda=DelayConnection(self.left_lip.e_contra, self.right_lip.i_ipsi, 'g_nmda',
        #    sparseness=self.params.p_ec_ii, weight=self.params.w_nmda_max, delay=(10*ms, 20*ms))
        self.connections.append(right_ec_ii_ampa)
        #self.connections.append(right_ec_ii_nmda)

        self.connections.extend(self.left_lip.connections)
        self.connections.extend(self.right_lip.connections)
示例#5
0
    def __init__(self,
                 lip_size,
                 params,
                 background_inputs=None,
                 visual_cortex_input=None,
                 go_input=None):
        self.lip_size = lip_size
        self.N = 2 * self.lip_size

        self.params = params
        self.background_inputs = background_inputs
        self.visual_cortex_input = visual_cortex_input
        self.go_input = go_input

        ## Set up equations

        # Exponential integrate-and-fire neuron
        eqs = exp_IF(params.C, params.gL, params.EL, params.VT, params.DeltaT)

        # AMPA conductance - recurrent input current
        eqs += exp_synapse('g_ampa_r', params.tau_ampa, siemens)
        eqs += Current('I_ampa_r=g_ampa_r*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - background input current
        eqs += exp_synapse('g_ampa_b', params.tau_ampa, siemens)
        eqs += Current('I_ampa_b=g_ampa_b*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - task input current
        eqs += exp_synapse('g_ampa_x', params.tau_ampa, siemens)
        eqs += Current('I_ampa_x=g_ampa_x*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - go input current
        eqs += exp_synapse('g_ampa_g', params.tau_ampa, siemens)
        eqs += Current('I_ampa_g=g_ampa_g*(E-vm): amp', E=params.E_ampa)

        # Voltage-dependent NMDA conductance
        eqs += biexp_synapse('g_nmda', params.tau1_nmda, params.tau2_nmda,
                             siemens)
        eqs += Equations('g_V = 1/(1+(Mg/3.57)*exp(-0.062 *vm/mV)) : 1 ',
                         Mg=params.Mg)
        eqs += Current('I_nmda=g_V*g_nmda*(E-vm): amp', E=params.E_nmda)

        # GABA-A conductance
        eqs += exp_synapse('g_gaba_a', params.tau_gaba_a, siemens)
        eqs += Current('I_gaba_a=g_gaba_a*(E-vm): amp', E=params.E_gaba_a)

        # GABA-B conductance
        eqs += biexp_synapse('g_gaba_b', params.tau1_gaba_b,
                             params.tau2_gaba_b, siemens)
        eqs += Current('I_gaba_b=g_gaba_b*(E-vm): amp', E=params.E_gaba_b)

        # Total synaptic conductance
        eqs += Equations(
            'g_syn=g_ampa_r+g_ampa_x+g_ampa_g+g_ampa_b+g_V*g_nmda+g_gaba_a+g_gaba_b : siemens'
        )
        eqs += Equations(
            'g_syn_exc=g_ampa_r+g_ampa_x+g_ampa_g+g_ampa_b+g_V*g_nmda : siemens'
        )
        # Total synaptic current
        eqs += Equations(
            'I_abs=abs(I_ampa_r)+abs(I_ampa_b)+abs(I_ampa_x)+abs(I_ampa_g)+abs(I_nmda)+abs(I_gaba_a) : amp'
        )

        NeuronGroup.__init__(self,
                             self.N,
                             model=eqs,
                             threshold=-20 * mV,
                             reset=params.EL,
                             compile=True)

        self.init_subpopulations()

        self.connections = []

        self.init_connectivity()

        if self.background_inputs is not None:
            # Background -> E+I population connections
            background_left_ampa = init_connection(self.background_inputs[0],
                                                   self.left_lip.neuron_group,
                                                   'g_ampa_b',
                                                   self.params.w_ampa_min,
                                                   self.params.w_ampa_max,
                                                   self.params.p_b_e,
                                                   delay=5 * ms)
            background_right_ampa = init_connection(
                self.background_inputs[1],
                self.right_lip.neuron_group,
                'g_ampa_b',
                self.params.w_ampa_min,
                self.params.w_ampa_max,
                self.params.p_b_e,
                delay=5 * ms)
            self.connections.append(background_left_ampa)
            self.connections.append(background_right_ampa)

        if self.visual_cortex_input is not None:
            # Task input -> E population connections
            vc_left_lip_ampa = init_connection(self.visual_cortex_input[0],
                                               self.left_lip.e_contra_vis,
                                               'g_ampa_x',
                                               self.params.w_ampa_min,
                                               self.params.w_ampa_max,
                                               self.params.p_v_ec_vis,
                                               delay=270 * ms)
            vc_right_lip_ampa = init_connection(self.visual_cortex_input[1],
                                                self.right_lip.e_contra_vis,
                                                'g_ampa_x',
                                                self.params.w_ampa_min,
                                                self.params.w_ampa_max,
                                                self.params.p_v_ec_vis,
                                                delay=270 * ms)
            self.connections.append(vc_left_lip_ampa)
            self.connections.append(vc_right_lip_ampa)

        if self.go_input is not None:
            go_left_lip_i_ampa = init_connection(self.go_input,
                                                 self.left_lip.i_group,
                                                 'g_ampa_g',
                                                 self.params.w_ampa_min,
                                                 self.params.w_ampa_max,
                                                 self.params.p_g_i,
                                                 delay=5 * ms)
            go_right_lip_i_ampa = init_connection(self.go_input,
                                                  self.right_lip.i_group,
                                                  'g_ampa_g',
                                                  self.params.w_ampa_min,
                                                  self.params.w_ampa_max,
                                                  self.params.p_g_i,
                                                  delay=5 * ms)
            go_left_lip_e_ampa = init_connection(self.go_input,
                                                 self.left_lip.e_group,
                                                 'g_ampa_g',
                                                 self.params.w_ampa_min,
                                                 self.params.w_ampa_max,
                                                 self.params.p_g_e,
                                                 delay=5 * ms)
            go_right_lip_e_ampa = init_connection(self.go_input,
                                                  self.right_lip.e_group,
                                                  'g_ampa_g',
                                                  self.params.w_ampa_min,
                                                  self.params.w_ampa_max,
                                                  self.params.p_g_e,
                                                  delay=5 * ms)
            self.connections.append(go_left_lip_i_ampa)
            self.connections.append(go_right_lip_i_ampa)
            self.connections.append(go_left_lip_e_ampa)
            self.connections.append(go_right_lip_e_ampa)
示例#6
0
    def init_connectivity(self):
        # Init connections from contralaterally tuned pyramidal cells to other
        # contralaterally tuned pyramidal cells in the same hemisphere
        self.connections.append(init_connection(self.e_contra_mem, self.e_contra_mem, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ec_mem_ec_mem, delay=5*ms, allow_self_conn=False))
        self.connections.append(init_connection(self.e_contra_mem, self.e_contra_mem, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ec_mem_ec_mem, delay=5*ms, allow_self_conn=False))

        self.connections.append(init_connection(self.e_contra_vis, self.e_contra_vis, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ec_vis_ec_vis, delay=5*ms, allow_self_conn=False))
        self.connections.append(init_connection(self.e_contra_vis, self.e_contra_vis, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ec_vis_ec_vis, delay=5*ms, allow_self_conn=False))

        ec_vis_ec_mem_ampa=init_connection(self.e_contra_vis, self.e_contra_mem, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ec_vis_ec_mem, delay=5*ms)
        ec_vis_ec_mem_nmda=init_connection(self.e_contra_vis, self.e_contra_mem, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ec_vis_ec_mem, delay=5*ms)
        self.connections.append(ec_vis_ec_mem_ampa)
        self.connections.append(ec_vis_ec_mem_nmda)

        # Init connections from ipsilaterally tuned interneurons to contralaterally
        # tuned pyramidal cells in the same hemisphere
        ii_ec_gabaa=init_connection(self.i_ipsi, self.e_contra, 'g_gaba_a', self.params.w_gaba_a_min,
            self.params.w_gaba_a_max, self.params.p_ii_ec, delay=5*ms)
        ii_ec_gabab=init_connection(self.i_ipsi, self.e_contra, 'g_gaba_b', self.params.w_gaba_b_min,
            self.params.w_gaba_b_max, self.params.p_ii_ec, delay=5*ms)
        self.connections.append(ii_ec_gabaa)
        self.connections.append(ii_ec_gabab)

        # Init connections from ipsilaterally tuned pyramidal cells to other
        # ipsilaterally tuned pyramidal cells in the same hemisphere
        self.connections.append(init_connection(self.e_ipsi_mem, self.e_ipsi_mem, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ei_mem_ei_mem, delay=5*ms, allow_self_conn=False))
        self.connections.append(init_connection(self.e_ipsi_mem, self.e_ipsi_mem, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ei_mem_ei_mem, delay=5*ms, allow_self_conn=False))

        self.connections.append(init_connection(self.e_ipsi_vis, self.e_ipsi_vis, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ei_vis_ei_vis, delay=5*ms, allow_self_conn=False))
        self.connections.append(init_connection(self.e_ipsi_vis, self.e_ipsi_vis, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ei_vis_ei_vis, delay=5*ms, allow_self_conn=False))

        ei_vis_ei_mem_ampa=init_connection(self.e_ipsi_vis, self.e_ipsi_mem, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ei_vis_ei_mem, delay=5*ms)
        ei_vis_ei_mem_nmda=init_connection(self.e_ipsi_vis, self.e_ipsi_mem, 'g_nmda', self.params.w_nmda_min,
            self.params.w_nmda_max, self.params.p_ei_vis_ei_mem, delay=5*ms)
        self.connections.append(ei_vis_ei_mem_ampa)
        self.connections.append(ei_vis_ei_mem_nmda)

        # Init connections from contralaterally tuned interneurons to ipsilaterally
        # tuned pyramidal cells in the same hemisphere
        ic_ei_gabaa=init_connection(self.i_contra, self.e_ipsi, 'g_gaba_a', self.params.w_gaba_a_min,
            self.params.w_gaba_a_max, self.params.p_ic_ei, delay=5*ms)
        ic_ei_gabab=init_connection(self.i_contra, self.e_ipsi, 'g_gaba_b', self.params.w_gaba_b_min,
            self.params.w_gaba_b_max, self.params.p_ic_ei, delay=5*ms)
        self.connections.append(ic_ei_gabaa)
        self.connections.append(ic_ei_gabab)

        # Init connections from ipsilaterally tuned pyramidal cells to ipsilaterally
        # tuned interneurons in the same hemisphere
        ei_ii_ampa=init_connection(self.e_ipsi, self.i_ipsi, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ei_ii, delay=5*ms)
        #ei_ii_nmda=DelayConnection(self.e_ipsi, self.i_ipsi, 'g_nmda', sparseness=self.params.p_ei_ii,
        #    weight=self.params.w_nmda_max, delay=delay=5*ms)
        #ei_ii_nmda=process_connection(ei_ii_nmda, self.e_ipsi, self.i_ipsi, self.params.w_nmda_min,
        #    self.params.w_nmda_max)
        self.connections.append(ei_ii_ampa)
        #self.connections.append(ei_ii_nmda)

        # Init connections from contralaterally tuned pyramidal cells to
        # contralaterally tuned interneurons in the same hemisphere
        ec_ic_ampa=init_connection(self.e_contra, self.i_contra, 'g_ampa_r', self.params.w_ampa_min,
            self.params.w_ampa_max, self.params.p_ec_ic, delay=5*ms)
        #ec_ic_nmda=DelayConnection(self.e_contra, self.i_contra, 'g_nmda', sparseness=self.params.p_ec_ic,
        #    weight=self.params.w_nmda_max, delay=delay=5*ms)
        #ec_ic_nmda=process_connection(ec_ic_nmda, self.e_contra, self.i_contra, self.params.w_nmda_min,
        #    self.params.w_nmda_max)
        self.connections.append(ec_ic_ampa)
示例#7
0
    def __init__(self, lip_size, params, background_inputs=None, visual_cortex_input=None,
                 go_input=None):
        self.lip_size=lip_size
        self.N=2*self.lip_size

        self.params=params
        self.background_inputs=background_inputs
        self.visual_cortex_input=visual_cortex_input
        self.go_input=go_input

        ## Set up equations

        # Exponential integrate-and-fire neuron
        eqs = exp_IF(params.C, params.gL, params.EL, params.VT, params.DeltaT)

        # AMPA conductance - recurrent input current
        eqs += exp_synapse('g_ampa_r', params.tau_ampa, siemens)
        eqs += Current('I_ampa_r=g_ampa_r*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - background input current
        eqs += exp_synapse('g_ampa_b', params.tau_ampa, siemens)
        eqs += Current('I_ampa_b=g_ampa_b*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - task input current
        eqs += exp_synapse('g_ampa_x', params.tau_ampa, siemens)
        eqs += Current('I_ampa_x=g_ampa_x*(E-vm): amp', E=params.E_ampa)

        # AMPA conductance - go input current
        eqs += exp_synapse('g_ampa_g', params.tau_ampa, siemens)
        eqs += Current('I_ampa_g=g_ampa_g*(E-vm): amp', E=params.E_ampa)

        # Voltage-dependent NMDA conductance
        eqs += biexp_synapse('g_nmda', params.tau1_nmda, params.tau2_nmda, siemens)
        eqs += Equations('g_V = 1/(1+(Mg/3.57)*exp(-0.062 *vm/mV)) : 1 ', Mg=params.Mg)
        eqs += Current('I_nmda=g_V*g_nmda*(E-vm): amp', E=params.E_nmda)

        # GABA-A conductance
        eqs += exp_synapse('g_gaba_a', params.tau_gaba_a, siemens)
        eqs += Current('I_gaba_a=g_gaba_a*(E-vm): amp', E=params.E_gaba_a)

        # GABA-B conductance
        eqs += biexp_synapse('g_gaba_b', params.tau1_gaba_b, params.tau2_gaba_b, siemens)
        eqs += Current('I_gaba_b=g_gaba_b*(E-vm): amp', E=params.E_gaba_b)

        # Total synaptic conductance
        eqs += Equations('g_syn=g_ampa_r+g_ampa_x+g_ampa_g+g_ampa_b+g_V*g_nmda+g_gaba_a+g_gaba_b : siemens')
        eqs += Equations('g_syn_exc=g_ampa_r+g_ampa_x+g_ampa_g+g_ampa_b+g_V*g_nmda : siemens')
        # Total synaptic current
        eqs += Equations('I_abs=abs(I_ampa_r)+abs(I_ampa_b)+abs(I_ampa_x)+abs(I_ampa_g)+abs(I_nmda)+abs(I_gaba_a) : amp')

        NeuronGroup.__init__(self, self.N, model=eqs, threshold=-20*mV, reset=params.EL, compile=True)

        self.init_subpopulations()

        self.connections=[]

        self.init_connectivity()

        if self.background_inputs is not None:
            # Background -> E+I population connections
            background_left_ampa=init_connection(self.background_inputs[0], self.left_lip.neuron_group, 'g_ampa_b',
                self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_b_e, delay=5*ms)
            background_right_ampa=init_connection(self.background_inputs[1], self.right_lip.neuron_group, 'g_ampa_b',
                self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_b_e, delay=5*ms)
            self.connections.append(background_left_ampa)
            self.connections.append(background_right_ampa)

        if self.visual_cortex_input is not None:
            # Task input -> E population connections
            vc_left_lip_ampa=init_connection(self.visual_cortex_input[0], self.left_lip.e_contra_vis, 'g_ampa_x',
                self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_v_ec_vis, delay=270*ms)
            vc_right_lip_ampa=init_connection(self.visual_cortex_input[1], self.right_lip.e_contra_vis, 'g_ampa_x',
                self.params.w_ampa_min, self.params.w_ampa_max, self.params.p_v_ec_vis, delay=270*ms)
            self.connections.append(vc_left_lip_ampa)
            self.connections.append(vc_right_lip_ampa)

        if self.go_input is not None:
            go_left_lip_i_ampa=init_connection(self.go_input, self.left_lip.i_group, 'g_ampa_g', self.params.w_ampa_min,
                self.params.w_ampa_max, self.params.p_g_i, delay=5*ms)
            go_right_lip_i_ampa=init_connection(self.go_input, self.right_lip.i_group, 'g_ampa_g', self.params.w_ampa_min,
                self.params.w_ampa_max, self.params.p_g_i, delay=5*ms)
            go_left_lip_e_ampa=init_connection(self.go_input, self.left_lip.e_group, 'g_ampa_g', self.params.w_ampa_min,
                self.params.w_ampa_max, self.params.p_g_e, delay=5*ms)
            go_right_lip_e_ampa=init_connection(self.go_input, self.right_lip.e_group, 'g_ampa_g', self.params.w_ampa_min,
                self.params.w_ampa_max, self.params.p_g_e, delay=5*ms)
            self.connections.append(go_left_lip_i_ampa)
            self.connections.append(go_right_lip_i_ampa)
            self.connections.append(go_left_lip_e_ampa)
            self.connections.append(go_right_lip_e_ampa)
示例#8
0
    def init_connectivity(self, clock):
        self.connections = {}
        self.stdp = {}

        # Iterate over input groups
        for i in range(self.params.num_groups):

            # E population - recurrent connections
            self.connections["e%d->e%d_ampa" % (i, i)] = init_connection(
                self.groups_e[i],
                self.groups_e[i],
                "g_ampa_r",
                self.pyr_params.w_ampa_rec,
                self.params.p_e_e,
                delay=0.5 * ms,
                allow_self_conn=False,
            )
            self.connections["e%d->e%d_nmda" % (i, i)] = init_connection(
                self.groups_e[i],
                self.groups_e[i],
                "g_nmda",
                self.pyr_params.w_nmda,
                self.params.p_e_e,
                delay=0.5 * ms,
                allow_self_conn=False,
            )

        # E -> I excitatory connections
        self.connections["e->i_ampa"] = init_connection(
            self.group_e, self.group_i, "g_ampa_r", self.inh_params.w_ampa_rec, self.params.p_e_i, delay=0.5 * ms
        )
        self.connections["e->i_nmda"] = init_connection(
            self.group_e, self.group_i, "g_nmda", self.inh_params.w_nmda, self.params.p_e_i, delay=0.5 * ms
        )

        # I -> E - inhibitory connections
        self.connections["i->e_gabaa"] = init_connection(
            self.group_i, self.group_e, "g_gaba_a", self.pyr_params.w_gaba, self.params.p_i_e, delay=0.5 * ms
        )

        # I population - recurrent connections
        self.connections["i->i_gabaa"] = init_connection(
            self.group_i,
            self.group_i,
            "g_gaba_a",
            self.inh_params.w_gaba,
            self.params.p_i_i,
            delay=0.5 * ms,
            allow_self_conn=False,
        )

        if self.background_input is not None:
            # Background -> E+I population connections
            self.connections["b->ampa"] = DelayConnection(self.background_input, self, "g_ampa_b", delay=0.5 * ms)
            self.connections["b->ampa"][:, :] = 0
            for i in xrange(len(self.background_input)):
                if i < self.e_size:
                    self.connections["b->ampa"][i, i] = self.pyr_params.w_ampa_bak
                else:
                    self.connections["b->ampa"][i, i] = self.inh_params.w_ampa_bak

        if self.task_inputs is not None:
            # Task input -> E population connections
            for i in range(self.params.num_groups):
                self.connections["t%d->e%d_ampa" % (i, i)] = DelayConnection(
                    self.task_inputs[i], self.groups_e[i], "g_ampa_x"
                )
                self.connections["t%d->e%d_ampa" % (i, i)].connect_one_to_one(
                    weight=self.pyr_params.w_ampa_ext_correct, delay=0.5 * ms
                )
                self.connections["t%d->e%d_ampa" % (i, 1 - i)] = DelayConnection(
                    self.task_inputs[i], self.groups_e[1 - i], "g_ampa_x"
                )
                self.connections["t%d->e%d_ampa" % (i, 1 - i)].connect_one_to_one(
                    weight=self.pyr_params.w_ampa_ext_incorrect, delay=0.5 * ms
                )

                # Input projections plasticity
                self.stdp["stdp%d_%d" % (i, i)] = ExponentialSTDP(
                    self.connections["t%d->e%d_ampa" % (i, i)],
                    self.plasticity_params.tau_pre,
                    self.plasticity_params.tau_post,
                    self.plasticity_params.dA_pre,
                    self.plasticity_params.dA_post,
                    wmax=self.plasticity_params.gmax,
                    update="additive",
                    clock=clock,
                )
                self.stdp["stdp%d_%d" % (i, 1 - i)] = ExponentialSTDP(
                    self.connections["t%d->e%d_ampa" % (i, 1 - i)],
                    self.plasticity_params.tau_pre,
                    self.plasticity_params.tau_post,
                    self.plasticity_params.dA_pre,
                    self.plasticity_params.dA_post,
                    wmax=self.plasticity_params.gmax,
                    update="additive",
                    clock=clock,
                )