SpikeTimeGroup#
- class brainpy.dyn.SpikeTimeGroup(size, indices, times, spk_type=None, name=None, sharding=None, keep_size=False, mode=None, need_sort=True)[source]#
The input neuron group characterized by spikes emitting at given times.
>>> # Get 2 neurons, firing spikes at 10 ms and 20 ms. >>> SpikeTimeGroup(2, times=[10, 20]) >>> # or >>> # Get 2 neurons, the neuron 0 fires spikes at 10 ms and 20 ms. >>> SpikeTimeGroup(2, times=[10, 20], indices=[0, 0]) >>> # or >>> # Get 2 neurons, neuron 0 fires at 10 ms and 30 ms, neuron 1 fires at 20 ms. >>> SpikeTimeGroup(2, times=[10, 20, 30], indices=[0, 1, 0]) >>> # or >>> # Get 2 neurons; at 10 ms, neuron 0 fires; at 20 ms, neuron 0 and 1 fire; >>> # at 30 ms, neuron 1 fires. >>> SpikeTimeGroup(2, times=[10, 20, 20, 30], indices=[0, 0, 1, 1])
- Parameters:
size (
Union[int,Sequence[int]]) – The neuron group geometry.indices (
Union[Sequence,TypeVar(ArrayType,Array,Variable,TrainVar,Array,ndarray)]) – The neuron indices at each time point to emit spikes.times (
Union[Sequence,TypeVar(ArrayType,Array,Variable,TrainVar,Array,ndarray)]) – The time points which generate the spikes.