Skip to content

v0.2.0 - remove the Smith-Lewicki encoder

Choose a tag to compare

@jmxpearson jmxpearson released this 11 Sep 18:33
· 6 commits to main since this release

Removed

smith_lewicki.py (259 lines) and its three exports — SmithLewickiDictionary, sl_gram, sl_gram_to_spikes.

The Lewicki encoder was ruled out as a VEN front end: its forward/reversed activation correlation is ~0.99 because it is amplitude-invariant, so K4 caps at 1.22× against the Olshausen-Field encoder's 2.11×. It survived here only because finchsim's circuit path still used it, and that path is moving to OF. The README note explaining why it was kept goes with it.

The OF path is unchanged — the figure renders byte-identical to v0.1.1 and all 7 reproduction assertions pass.

Added: of_to_spikes(calibrate_on=...)

The rate scale is mean_rate_hz / act.mean() over the whole array, so handing it a sparse timeline — one song tiled into motif windows with silence between — divides by a mean diluted by the silence and inflates the rate during song. Measured on a 25% duty cycle: 61 Hz against a 15 Hz target. Passing the song-window activations as calibrate_on gives 14.2 Hz. Inert when unused (output identical with calibrate_on=None).

This is needed by the finchsim circuit migration, and is the kind of error that would otherwise have been adopted silently as 'the new AIV drive' rather than noticed.

Also

n_channels's docstring no longer points at a sibling class that no longer exists, and its test is parametrised over 5/7/64 widths instead of comparing two encoder classes.

27 fast tests (was 25), 7 reproduction assertions, lint clean.