Add NIDAQ-aligned session psychophysical kernel - #31
Merged
Conversation
Implement residual-rate kernel math with NaN masking for unseen late bins, persist results in PsychophysicalKernel, and add unit tests plus a diagnostic plotting entrypoint for GRB006 session validation. Co-authored-by: Gabriel Rojas-Bowe <rojasgabriel@users.noreply.github.com>
Parameterize PsychophysicalKernelParam with observation_window so the same residual-rate fit can be run on fixation-only flashes or on all flashes through the response poke, and overlay both in diagnostics. Co-authored-by: Gabriel Rojas-Bowe <rojasgabriel@users.noreply.github.com>
Add concise Odoemene/Huk/Katz/Yates/Okazawa references in the style of spks metrics, so residual-rate evidence and early/late labels are traceable from the code. Co-authored-by: Gabriel Rojas-Bowe <rojasgabriel@users.noreply.github.com>
rojasgabriel
marked this pull request as ready for review
August 3, 2026 20:16
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Summary
Adds an ephys-only, session-level psychophysical-kernel analysis for GRB006.
PsychophysicalKernelParam: versioned fixed-bin, observation-window, evidence-encoding, CV, and regularization settings.SessionPsychophysicalKernel: one NIDAQ-aligned kernel perSession × PsychophysicalKernelParam.src/utils/psychophysical_kernel.py: fixed 100 ms bins, unobserved late bins represented as NaN, complete-case prefix fitting, L2 logistic CV, fitted-set majority baseline, and Odoemene Eq. 5-style trial-rate contrasts.psychophysical_kernel_diagnostics.py: populate and diagnostic-figure entrypoint.Scope relative to behavior_analyses
The pooled
behavior_analyses.PsychophysicalKerneltable remains the canonical LabData surface for purely behavioral pooled fits. This PR does not replace or duplicate that table.This session table stays in
ephysbecause its center-exit and response windows require NIDAQEventMapping. A read-only reconciliation against a one-session pooled fit confirmed that the behavioral table can fit the same session, but cannot reproduce these fixed NIDAQ windows or the locked Eq. 5 analysis.Live validation and interpretation
Four rows were populated for GRB006
20240821_121447: the original max-rate variants and the locked trial-rate center/response variants. The locked center and response fits both performed below their fitted-set majority baselines, and the early/late label changed under principal sensitivity checks.The result is diagnostic only: it does not support an early- versus late-integrator claim or a directional link to the V1 category time course.
Verification
uvx --from ruff==0.15.0 ruff check .uvx --from ruff==0.15.0 ruff format --check .uvx --from ty==0.0.37 ty checkpython -m unittest discover -s tests— 29 passedgit diff --checkThe final corrective commit also instantiates the DataJoint computed table before
populateand widens the heterogeneous extraction result annotation, resolving all six priortydiagnostics.