Repository navigation
Opt-in fibre types by motor unit, surface EMG from Muscle fibres, FDI fibre diameter - #45
Merged
Merged
Conversation
The default, fiber_model="independent", keeps one log-normal diameter per fibre and the CV line plus 0.2 m/s. The typed model sets fibre types and diameters per unit (Polgar FDI type means, Martin within-unit spread) and CVs over unit means or per unit; its arguments raise under the default. Reference fibres are stored as values, not byte hashes.
SurfaceFiberDispersion(fiber_properties="muscle") takes every fibre's CV and diameter from Muscle (either fibre model). Per-unit CVs, a source scaled by d^2 normalised over the muscle, and SurfaceEMG fiber_diameter__um 50 -> 57.9 um (FDI RMS, Polgar 1973).
Arms use the typed fibre model. All inputs live under spikes/ and unit_cv/ and resolve relative to the benchmark directory.
This was referenced Nov 7, 2026
…oint The fast-marching field has exact ties (the mirror pair at the second centre, and 12 more within the first 300 centres). np.argmax took whichever cell a platform's floating point put a last bit higher; on macOS arm64 the layout came out different and the stored typed fibre diameters failed. Ties within 1e-12 relative now go to the lowest index, which is what argmax returns on exact ties, so layouts on this machine are unchanged (stored values still pass). Distinct values differ by at least 2.6e-9 relative over 300 centres. Tested with 1e-13 relative noise on the field.
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.
Fourth of four stacked PRs that replace #41: #40 → #43 → #44 → this. Base is
feat/dd-optimiser-tooling; retarget tomainonce #44 merges.Closes #30, closes #35, closes #36, closes #37.
Breaking: default surface-EMG amplitudes rise 34 % through the FDI fibre diameter (#30).
SurfaceEMG(fiber_diameter__um=57.9), the FDI RMS fibre diameter (Polgar et al. 1973); was 50. The source scales with d², so amplitudes rise by (57.9/50)² = 1.34 and spectra do not change.Musclefibre model: typed by motor unit, Polgar diameters, Del Vecchio CVs, within-unit spread #35Muscle(fiber_model="typed"), opt-in: one fibre type per motor unit in recruitment order (Polgar), one diameter ladder across the pool, within-unit spread per type (Martin et al. 1988), CV on the Nandedkar–Stålberg line with 4.32 ± 0.71 m/s over unit means (Del Vecchio et al. 2018) or per-unit CVs from recruitment force. The defaultfiber_model="independent"keeps the fibres of Ported fixes: iEMG SFAP units and execution route, fibre CV units, Gfluctdv noise #43 exactly (stored-value test), and typed-only arguments raise without the switch.Musclefibres in surface EMG #36 Surface fibre dispersion, and surface EMG from theMusclefibres (SurfaceFiberDispersion(fiber_properties="muscle")); opt-in.Musclefibres and per-unit CVs) is documented underiap_lambda__per_mm; the default stays 1.benchmarks/semg_dispersion: the FDI arms, with their spike-train and per-unit CV inputs in the repo.Evidence. FDI benchmark (same muscle, NEURON spike trains at 25 % MVC, Delsys 5-pin sensors, corner minus centre, median [IQR]): v0.13.0 28 mV / 455 Hz; defaults on this branch 0.253 mV [0.157–0.263] / 235 Hz (0.189 mV at the old 50 µm); typed
Musclefibres with dispersion and λ 0.63: 0.194 mV [0.129–0.209] / 168 Hz. Botelho et al. 2019: 0.21 mV [~0.19–0.26], ~165 Hz.Cross-platform fibres. Innervation-centre placement had exact ties in the fast-marching argmax, which platforms broke differently, so fibre-to-unit assignment differed between machines. Ties now go to the lowest index (what
argmaxreturned on exact ties, so layouts here are unchanged); tested with last-bit noise on the field.Tests. Full suite at
a34bb2244: 555 passed, 2 skipped; the later merge of #44 changes comments and the register only.Upgrade notes. See
CHANGELOG.md(Unreleased): Breaking changes and the typed fibre model.