FAQ | This is a LIVE service | Changelog

Skip to content

adaptation calculation overflow with long signals

Adaptation calculation was updated from Tim's original version to compute exp(t_spike_timings)*exp(-t_latest_spike) instead of exp(t_spike_timings - t_latest_spike)

this meant the code was much faster thanks to not having to compute the exponential for a whole vector at each spike. however this means that if t_latest_spike (and any value in t_spike_timings) becomes large (after a few seconds I think, depends on the adaptation time constant), then it overflows Matlab's precision.

an easy fix would be to throw back an error that explains why it crashed. not a real fix though

a more complicated fix if wanting to still not do the exp(t - t0) could be to re-reference things at some point, when adapation from old spikes can be safely ignored?