ezmsg.learn.process.flatten#
Flatten with time-lag-windowing struct semantics.
Thin wrapper around ezmsg.sigproc.flatten.FlattenTransformer
that detects the windowed-feature case (any input with both the
preserve dim — typically "win" — and a "time" lag dim alongside
a labeled feature axis) and attaches a structured lag
CoordinateAxis to the inner sample dim before delegating. The
output merged-axis struct then carries a real integer lag field
alongside the remaining feature dims, and sigproc’s canonical label
field composes naturally (e.g. "t-2/c0" for 3-D
(win, time, ch) or "t-2/c0/spk" for 4-D
(win, time, ch, feature)).
Outside the lag case this module delegates unchanged — prefer
ezmsg.sigproc.flatten.Flatten directly for the general
(time, ch, feature) → (time, ch_x_feature) collapse.
Classes
- class Flatten(*args, settings=None, **kwargs)[source]#
Bases:
BaseTransformerUnit[FlattenSettings,AxisArray,AxisArray,FlattenTransformer]- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
FlattenSettings
- class FlattenSettings(preserve_axis=None, sample_axis=None, feature_axis='ch')[source]#
Bases:
SettingsSettings for the learn-side
Flatten.Mirrors
ezmsg.sigproc.flatten.FlattenSettingsbut uses the historicalfeature_axisfield name and defaults oriented toward time-lag windowing.- preserve_axis: str | None = None#
Axis kept as the leading dim of the output. Defaults to the input’s leading dim (typically
"win"in the windowed pipeline).
- class FlattenTransformer(*args, **kwargs)[source]#
Bases:
BaseStatefulTransformer[FlattenSettings,AxisArray,AxisArray,_LagFlattenState]Time-lag-aware Flatten that delegates to the canonical sigproc unit.
On each shape change we detect the lag case and, if present, precompute a structured lag
CoordinateAxis. Per message that axis is injected into the inner sample dim before delegating to the inner sigproc transformer, which then produces an output merged-axis struct withlag(int),ch, and the sigproc-composed"label"("t-2/c0"style).