Changeset 1024
- Timestamp:
- 12/02/11 14:37:07 (6 months ago)
- Files:
-
- 1 modified
-
trunk/src/connectors.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/connectors.py
r1015 r1024 122 122 return values 123 123 elif isinstance(self.source, numpy.ndarray): 124 if len(self.source.shape) == 1: # for OneToOneConnector or AllToAllConnector used from or to only one Neuron 125 ## First we reshape the data, and reinit the source_iterator. This is a patch since data are selected according 126 ## to the post_synaptic index with local_mask. So therefore, the weights should be in the form of a matrix of size 127 ## n_pre lines and n_post columns. If this is a vector, we need to transpose it. 128 self.source = self.source.reshape((len(self.source), 1)) 129 self.source_iterator = iter(self.source) 124 130 if len(self.source.shape) == 2: 125 131 source_row = self.source_iterator.next() 126 132 values = source_row[self.local_mask] 127 elif len(self.source.shape) == 1: # for OneToOneConnector or AllToAllConnector used from or to only one Neuron128 values = self.source[self.local_mask]129 133 else: 130 134 raise Exception()
