Replies: 4 comments 3 replies
-
How are you presenting the data to the network? |
Beta Was this translation helpful? Give feedback.
-
what I meant was, how are you connecting the gesture dataset to the model? Are you using the built in spike source array model? |
Beta Was this translation helpful? Give feedback.
-
How are you resetting the
as well if your stimuli all start from t = 0. |
Beta Was this translation helpful? Give feedback.
-
I would recommend doing something like this. Firstly pre-process the spike times associated with each stimuli into GeNN format and calculate the maximum number of spikes across all stimuli: stim_spikes = []
max_spikes = 0
for spike_times in stim_spike_times:
spike_counts = [len(n) for n in spike_times]
end_spike = np.cumsum(spike_counts)
stim_spikes.append((spike_times, end_spike))
max_spike_times = max(max_spike_times, len(spike_times)) Then setup the spike source array, reserving enough memory for the maximum number of spikes: stim = model.add_neuron_population("Stim", number, "SpikeSourceArray", {},
{"startSpike": 0, "endSpike": 0})
stim.set_extra_global_param("spikeTimes", np.empty(max_spike_time)) Build and load the model: model.build()
model.load() Loop through the pre-processed spike times and present each one to the network: for spike_times, end_spikes in stim_spikes:
# Reinitialize model
model.reinitialise()
# Calculate start spikes
start_spike[0] = 0
start_spike[1:] = end_spike[0:-1]
# Copy start and end spike indices into view
stim.vars["startSpike"].view[:] = start_spike
stim.vars["endSpike"].view[:] = end_spike
# Copy spike times into (start of) view
stim.extra_global_params["spikeTimes"][:len(spike_times)] = spike_times
# Copy
stim.push_var_to_device("startSpike")
stim.push_var_to_device("endSpike")
stim.push_extra_global_param_to_device("endSpike")
# **TODO** simulate |
Beta Was this translation helpful? Give feedback.
-
In GeNN, I stitched together two identical 1650ms input data to generate a 3300ms input. I'm trying to use the reinitialise() command at 1650ms to reset the state of the network to run the second piece of data in the same connection mode. But calculating the instantaneous firing rate of the spikes after I simulated the network gave me the following graph. The firing rate simulated in the first segment of the data is completely different from that in the second segment. The connection between the populations in my model is using the "FixedNumberTotalWithReplacement" mode, we want to run the two pieces of data with the same connection matrix, can someone please help me?
Beta Was this translation helpful? Give feedback.
All reactions