data_basedb_initializersprepare_ANN_batchesspike_times_to_onehot

spike_times_to_onehot

data_base.db_initializers.prepare_ANN_batches.spike_times_to_onehot(spike_times, min_time=0, max_time=505, time_step=1)

One-hot encode spike times to a binned time vector.

The time vector is created from min_time, max_time and time_step and is of length (max\_time - min\_time)//time\_step.

If a spike occured in a certain time interval, the corresponding entry in the one-hot vector is set to True.

Parameters:
  • spike_times (array) – Array of spike times

  • min_time (int, optional) – Min time in ms. Defaults to 0.

  • max_time (int, optional) – Max time in ms. Defaults to 505.

  • time_step (int, optional) – Timestep in ms. Defaults to 1.

Returns:

A list of booleans, where each element represents a time step and is True if a spike occured in this interval.

Return type:

list