DeltaEncoder

Contents

DeltaEncoder#

class braintools.DeltaEncoder(threshold=0.1, positive_only=False, absolute=False, normalize=True)#

Encode temporal differences (delta changes) in input signals.

Generates spikes when the input signal changes significantly between time steps. Useful for encoding dynamic signals and temporal patterns.

Example:

>>> # Encode a changing signal
>>> time_series = jnp.array([0, 0.1, 0.8, 0.7, 0.2])
>>> encoder = DeltaEncoder(threshold=0.1)
>>> spikes = encoder(time_series)  # Spikes at significant changes
Parameters:
  • threshold (float) – float. Minimum change required to generate a spike.

  • positive_only (bool) – bool. Whether to encode only positive changes.

  • absolute (bool) – bool. Whether to use absolute value of changes.

  • normalize (bool) – bool. Whether to normalize the input signal.