def generate_synapse_list(self, prevertex, postvertex, delay_scale, 
            synapse_type):
        id_lists = list()
        weight_lists = list()
        delay_lists = list()
        type_lists = list()
        for _ in range(0, prevertex.atoms):
            id_lists.append(list())
            weight_lists.append(list())
            delay_lists.append(list())
            type_lists.append(list())
        
        pre_synaptic_neurons = random.sample(range(0, prevertex.atoms), 
                self.n_pre)
 
        for pre_atom in pre_synaptic_neurons:
            present = numpy.ones(postvertex.atoms, dtype=numpy.uint32)
            n_present = postvertex.atoms
            
            id_lists[pre_atom] = numpy.where(present)[0]
            weight_lists[pre_atom] = generateParameterArray(self.weights,
                    n_present, present)
            delay_lists[pre_atom] = (generateParameterArray(self.delays,
                    n_present, present) * delay_scale)
            type_lists[pre_atom] = synapse_type
        
        connection_list = [SynapseRowInfo(id_lists[i], weight_lists[i], 
                delay_lists[i], type_lists[i])
                for i in range(0, prevertex.atoms)]
        
        return SynapticList(connection_list)
Exemple #2
0
    def generate_synapse_list(self, prevertex, postvertex, delay_scale,
                              synapse_type):
        id_lists = list()
        weight_lists = list()
        delay_lists = list()
        type_lists = list()
        for _ in range(0, prevertex.atoms):
            id_lists.append(list())
            weight_lists.append(list())
            delay_lists.append(list())
            type_lists.append(list())

        pre_synaptic_neurons = random.sample(range(0, prevertex.atoms),
                                             self.n_pre)

        for pre_atom in pre_synaptic_neurons:
            present = numpy.ones(postvertex.atoms, dtype=numpy.uint32)
            n_present = postvertex.atoms

            id_lists[pre_atom] = numpy.where(present)[0]
            weight_lists[pre_atom] = generateParameterArray(
                self.weights, n_present, present)
            delay_lists[pre_atom] = (
                generateParameterArray(self.delays, n_present, present) *
                delay_scale)
            type_lists[pre_atom] = synapse_type

        connection_list = [
            SynapseRowInfo(id_lists[i], weight_lists[i], delay_lists[i],
                           type_lists[i]) for i in range(0, prevertex.atoms)
        ]

        return SynapticList(connection_list)
Exemple #3
0
 def generate_synapse_list(self, prevertex, postvertex, delay_scale,
         synapse_type):
     rows = list()
     for _ in range(0, prevertex.atoms):
         
         present = numpy.random.rand(postvertex.atoms) <= self.p_connect
         n_present = numpy.sum(present)
         
         ids = numpy.where(present)[0]
         delays = (generateParameterArray(self.delays, n_present, present)
                 * delay_scale)
         weights = generateParameterArray(self.weights, n_present, present)
         synapse_types = (numpy.ones(len(ids), dtype='uint32') 
                 * synapse_type)
         
         rows.append(SynapseRowInfo(ids, weights, delays, synapse_types))
     return SynapticList(rows)
    def generate_synapse_list(self, prevertex, postvertex, delay_scale,
                              synapse_type):

        connection_list = list()
        for _ in range(0, prevertex.atoms):
            present = numpy.ones(postvertex.atoms, dtype=numpy.uint32)
            n_present = postvertex.atoms

            ids = numpy.where(present)[0]
            delays = (generateParameterArray(self.delays, n_present, present) *
                      delay_scale)
            weights = generateParameterArray(self.weights, n_present, present)
            synapse_types = (numpy.ones(len(ids), dtype='uint32') *
                             synapse_type)

            connection_list.append(
                SynapseRowInfo(ids, weights, delays, synapse_types))

        return SynapticList(connection_list)
 def generate_synapse_list(self, prevertex, postvertex, delay_scale, 
         synapse_type):
     
     connection_list = list()
     for _ in range(0, prevertex.atoms):
         present = numpy.ones(postvertex.atoms, 
                 dtype=numpy.uint32)
         n_present = postvertex.atoms
         
         ids = numpy.where(present)[0]
         delays = (generateParameterArray(self.delays, n_present, present)
                 * delay_scale)
         weights = generateParameterArray(self.weights, n_present, present)
         synapse_types = (numpy.ones(len(ids), dtype='uint32') 
                 * synapse_type)
         
         connection_list.append(SynapseRowInfo(ids, weights, delays,
                 synapse_types))
                 
     return SynapticList(connection_list)