示例#1
0
 def transform_traces(self, traces):
     # from standard structure to inline structure
     K, T = traces.shape
     traces_inline = traces.flatten()
     traces_offset = array(kron(arange(K), T * ones(self.subpopsize)),
                           dtype=int)
     return traces_inline, traces_offset
示例#2
0
 def initialize_statemonitor(self):
     self.statemonitor_values = [gpuarray.to_gpu(zeros(self.N*self.duration, 
                                                       dtype=self.precision))
                                 for state in self.statemonitor_var]
     self.statemonitor_offsets = gpuarray.to_gpu(arange(0, self.duration*self.N+1,
                                                        self.duration, 
                                                        dtype=int32))
示例#3
0
 def initialize_spikemonitor(self):
     self.spikemonitor_values = gpuarray.to_gpu(
         zeros(self.N * self.nbr_spikes, dtype=self.precision))
     self.spikemonitor_offsets = gpuarray.to_gpu(
         arange(0,
                self.nbr_spikes * self.N + 1,
                self.nbr_spikes,
                dtype=int32))
示例#4
0
 def initialize_statemonitor(self):
     self.statemonitor_values = [
         gpuarray.to_gpu(zeros(self.N * self.duration,
                               dtype=self.precision))
         for state in self.statemonitor_var
     ]
     self.statemonitor_offsets = gpuarray.to_gpu(
         arange(0, self.duration * self.N + 1, self.duration, dtype=int32))
示例#5
0
 def transform_traces(self, traces):
     # from standard structure to inline structure
     K, T = traces.shape
     traces_inline = traces.flatten()
     traces_offset = array(kron(arange(K), T*ones(self.subpopsize)), dtype=int)
     return traces_inline, traces_offset
示例#6
0
 def initialize_spikemonitor(self):
     self.spikemonitor_values = gpuarray.to_gpu(zeros(self.N*self.nbr_spikes, 
                                                       dtype=self.precision))
     self.spikemonitor_offsets = gpuarray.to_gpu(arange(0, self.nbr_spikes*self.N+1,
                                                self.nbr_spikes, 
                                                dtype=int32))