Struct Spike
Defined in File Spike.h
Struct Documentation
-
struct Spike
Spike event. Spikes are fired and received by spiking neurons. They drive the computation during inference.
Public Functions
-
Spike() = default
Default constructor.
-
Spike(unsigned int index, float time)
Constructs a spike with a given index and timing.
- Parameters
index – The index of the neuron that fired the spike.
time – The timing of the spike.
-
bool operator==(const Spike &rhs) const
Checks if two spikes occured within a time distance of Spike::epsilon, i.e. std::abs(this->time - rhs.time) < epsilon.
- Parameters
rhs – The other spike to compare.
- Returns
True if the absolute difference between the two spike timings is bellow Spike::epsilon.
-
bool operator!=(const Spike &rhs) const
Checks if two spikes did not occur within a time distance of Spike::epsilon, i.e. std::abs(this->time - rhs.time) >= epsilon.
- Parameters
rhs – The other spike to compare.
- Returns
True if the absolute difference between the two spike timings is above Spike::epsilon.
-
bool operator<(const Spike &rhs) const
Checks if the spike occured before a given spike, i.e. this->time < rhs.time.
- Parameters
rhs – The other spike to compare.
- Returns
True if the spike occured before rhs.
-
bool operator<=(const Spike &rhs) const
Checks if the spike occured before or at the same time as given spike, i.e. this->time <= rhs.time.
- Parameters
rhs – The other spike to compare.
- Returns
True if the spike occured before or at the same time as rhs.
Public Members
-
unsigned int index
Index (in the layer) of the neuron that fired the spike.
-
float time
Timing of the spike.
Public Static Attributes
-
static constexpr float epsilon = 1e-6
Time difference within two spikes are considered equal.
-
Spike() = default