Repository navigation
feat(experiments): one-presentation recording, task responses and native input forms - #209
Merged
Merged
Conversation
… presentation A BrainScoreModel session may now request behavior together with neural:<region>. Each stimulus is shown once: with answer, extractors record the prompt pass through an optional record(layers); with a readout, region layers are extracted in the same call as the readout layer. A neural-only session after a configured task now returns activity instead of the behavioral assembly.
…uts on the intact network A session with a non-passive task_context that requests only neural channels now records during the task. TaskContext gains readout_fit: 'intact' fits the readout with every active change undone and tests the changed network with it. Recordings made during a task carry attrs['recording']; plain neural sessions are unchanged.
TaskContext gains response: Choice (optionally with implied probabilities or reported confidence), Scale for ratings, and Text for written answers. Each response phrases its directive and parses replies; answers arrive on addressed behavior:<kind> channels that each part declares, so compatibility is decided before compute. BrainScoreModel gains reply and likelihood parts, and a ridge readout gives ratings for feature models. task_type values keep their meaning on plain behavior.
vision is now addressable by form: a vision-keyed extractor declares vision:still and a video-keyed one vision:clip. A subject with both takes each stimulus in its own form: clips go to the video extractor, stills to the vision one.
…ecording reply and likelihood now receive a Prompt: the instruction, the stimulus parts in TaskContext.present order, then the response's directive. A stimulus with several parts and no declared order fails before any compute. Recording during a task picks the extractor that matches the stimulus's form and keeps a clip's time steps.
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.
The experiment API for UMI v2 in core: a study reads like a lab protocol (describe the task, bring in a subject, attach recorders, run once), and every subject sees each stimulus in its own native form. This folds in what was #210. Paired with KartikP/brainscore-unified#54; the two are pinned to each other (
umi-v2.ymlhere,install/peer-revisions.jsonthere).What changes
1. Behavior and activity from one presentation. A
BrainScoreModelsession may ask forbehaviorandneural:<region>together. The regions are recorded during the same forward pass that produced the answer, and each stimulus is shown once.task_contextdecides what the subject does; the requested outputs decide what is measured.task_type='passive'means plain viewing.neural:*under a real task records during that task.TaskContext.readout_fit:'intact'fits a readout with every active change undone, then tests the changed network with it. The default'current'is unchanged.attrs['recording']. Plain neural sessions are unchanged.2. The form of the answer:
TaskContext.response(brainscore_core.responses):Choice(labels)behavior:choiceChoice(..., probabilities=True)+ behavior:probabilities(implied)Choice(..., confidence=Scale(...))+ behavior:confidence(reported)Scale(low, high, step)behavior:ratingText()behavior:textattrs['measure'].reply(prompt)andlikelihood(prompt, candidates).RatingRegressorgives ratings for readout models.behavior:<kind>channels it can give, so mismatches are N/A before any compute.task_typevalues keep their path on plainbehavior.3. Native input forms and ordered trials.
visionis addressable asvision:still(declared by avision-keyed extractor) andvision:clip(declared by avideo-keyed one). A subject with both takes each stimulus in its own form, so a clip goes to the clip extractor.Promptin this order: the instruction, the stimulus parts inTaskContext.presentorder, then the response's directive. A stimulus with several parts and no declared order fails before any compute.Rule 9.3 reason:
TaskContextis a session setting. Separating the task from the form of its answer neededtask_typeto become optional, which adding a field alone couldn't do. Every existing call keeps its meaning.Out of scope, each raising a clear error before any compute:
Verification
test_joint_behavior_neural.py(10 tests): one presentation, prompt-dependent activity,readout_fit, neural-only sessions under a task, plain sessions unchanged.test_task_responses.py(12 tests): parsing, confidence, ratings from a reply and a readout, text, likelihood and readout probabilities, N/A cases, trial order.test_visual_forms.py(6 tests): form declarations, dispatch by form, clip time steps during a task.generatecalls.(presentation, neuroid), and clips as(presentation, time_bin, neuroid): three 1-second bins for a 3-second clip at 2 fps;