Repository navigation
feat(tasks): multi-image trials, memory traits, fused extractors and implied reaction times - #211
Merged
Merged
Conversation
…h image
TaskContext.present accepts named parts ('image:word_1') so one trial
can show a sequence before a single answer. Prompts carry part names,
and a multi-image trial's recording keeps one step per image, labelled
by part.
Recording during a task now works during likelihood scoring, next to a reply with implied probabilities (scored first from the same prompt), for composite regions, in streaming sessions (outputs sent per trial), and for extractors without record() through forward hooks on the model passed as model=.
Subject gains traits (empty by default). A benchmark that needs one lists it in required_traits, and pre-flight marks a subject without it N/A. BrainScoreModel(memory='session') declares memory:session and passes each earlier trial's prompt and reply to reply/likelihood as prompt.history; reset() and the start of a new session clear it.
extractor={('vision', 'text'): fused} declares each type and is called
once for a stimulus that brings several of them; single-type
extractors still take single-type stimuli.
Choice(labels, reaction_time='evidence_margin' | 'surprisal') returns an implied RT per stimulus on behavior:rt, from the readout's or the likelihood's label probabilities, labelled with its link. Readout and likelihood parts declare behavior:rt.
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.
Lets a
BrainScoreModeltake part in lab-style studies. Paired with KartikP/brainscore-unified#56, which adds the matching wrappers, tools, registrations and the flagship notebook. The two are pinned to each other (umi-v2.ymlhere,install/peer-revisions.jsonthere).What changes
Multi-image trials.
TaskContext.presentaccepts named parts, so one trial can show a sequence before a single answer:(presentation, part, neuroid), labelled by part.Recording on every task path. Each case below used to raise before any compute; it now records the prompt pass:
likelihoodpart must run the prompt on its own first, which is now documented);record(), through forward hooks on the module passed asmodel=.Memory across trials (contract change).
Subject.traitsis empty by default. A benchmark that needs one lists it inrequired_traits, and pre-flight marks a subject without it N/A. This is rule 5.10.BrainScoreModel(memory='session')declaresmemory:sessionand passes earlier trials toreplyandlikelihoodasprompt.history.reset()and the start of a new session clear it.Fused extractors.
extractor={('vision', 'text'): fused}declares each input type and is called once for a stimulus that brings several of them. Single-type extractors still take single-type stimuli.Implied reaction times.
Choice(labels, reaction_time='evidence_margin' | 'surprisal')returns an implied RT onbehavior:rt, computed from the readout's or likelihood's label probabilities and labelled with its link. They're scored by correlation, as Futrell2018 scores surprisal and Kar2019 scores solution times. Readout and likelihood parts declarebehavior:rt.Two tests that pin
out_channelsnow includebehavior:rt. Two tests that usedvisionas an example of a family without addresses now usetext.Verification
test_session_memory.py: a 1-back task that only a model with memory solves; N/A in pre-flight; reset.test_recording_everywhere.py: every path above.test_fused_extractor.py.test_task_responses.py: named parts, implied RTs.test_visual_forms.py: recording per image.image,text,final; shape (2, 3, 3584)memory='session'reset()