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
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))
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))
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))
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
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))