Repository navigation
Keep the threshold scaler across a segment; test segment handling - #42
Merged
Merged
Conversation
With ezmsg-baseproc 1.16 a stateful processor is reset when a message's segment changes, which is right for everything these processors carry between chunks: a tail of samples, refractory counts, a kernel's decaying activation, a partly filled bin. Nothing here needed changing for that, and every output already carries the input's segment and attrs. The one exception is ThresholdCrossing's auto-scaler, whose running statistics describe the signal and are not dated by a gap. It is now kept across a new segment, where a full reset used to rebuild it, and applies its own rule (reset_on_resume) to the segment it sees. tests/test_segments.py pins both properties for every processor: segment and attrs reach the output, and the first message of a new segment is processed as a fresh processor would. Requires ezmsg>=3.10.0b6 and ezmsg-baseproc>=1.16.0.
The first release whose AdaptiveStandardScaler keeps its statistics across a segment, which ThresholdCrossing's auto-scaler relies on.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the gap-handling work tracked in ezmsg-org/ezmsg-sigproc#247. The sources (ezmsg-nwb, ezmsg-blackrock, ezmsg-neo, ezmsg-xdf) now set
AxisArray.segment; this checks what the event processors do with it.Findings
An audit of every processor, backed by the new tests:
segmentandattrsalready reach every output. All of them build their output withreplace(message, ...).ThresholdCrossingThresholdCrossingwithauto_scale_tauRefractorySparseKernelInserterBinnedKernelActivation,RateBinnedEventAggregatorPoissonEventThe one change
ThresholdCrossingTransformer._reset_segmentkeeps the auto-scaler. Its running mean and variance describe the signal and are not dated by a gap; rebuilding it mis-scales the samples after every gap. The scaler sees the new segment itself and applies its own rule (reset_on_resume), the same as a standaloneAdaptiveStandardScalerin ezmsg-sigproc.Tests
tests/test_segments.py, for each of the six processors (andThresholdCrossingwith peak alignment):segmentandattrsreach the output;ThresholdCrossing, the same message without a segment change does not, so the test can tell the difference.Plus one for the scaler being kept. 185 passed against ezmsg-sigproc 3.12.0, the first release whose scaler keeps its statistics across a segment.
Not changed
PoissonEventredraws its thresholds; it is a simulator.Requires
ezmsg>=3.10.0b6,ezmsg-baseproc>=1.16.0andezmsg-sigproc>=3.12.0.