Repository navigation
towards adding Pereira2018ROI as a benchmark - #37
aalok-sathe wants to merge 545 commits into
Conversation
…e-implementing classes
…fuzzy-potato into dev
deleted: langbrainscore/benchmark_packaging/.gitkeep deleted: langbrainscore/benchmark_packaging/package_benchmarks.py
…are cached with `HugingFaceEncoder`
mschrimpf
left a comment
There was a problem hiding this comment.
High-level comment: I think the benchmark should go inside pereira2018 rather than a new plugin pereira2018_v2022 -- @kvfairchild do you agree?
Note that unit tests are failing; if you'd like to put this data onto the S3 bucket that we used for the other data, slack me and I'll get you write access.
| ### project specific additions: | ||
|
|
||
| brainscore_language/data | ||
| # brainscore_language/data |
There was a problem hiding this comment.
dead specification, either delete or leave, no commented code
| BIBTEX = """@article{pereira2018toward, | ||
| title={Toward a universal decoder of linguistic meaning from brain activation}, | ||
| author={Pereira, Francisco and Lou, Bin and Pritchett, Brianna and Ritter, Samuel and Gershman, Samuel J | ||
| and Kanwisher, Nancy and Botvinick, Matthew and Fedorenko, Evelina}, | ||
| journal={Nature communications}, | ||
| volume={9}, | ||
| number={1}, | ||
| pages={1--13}, | ||
| year={2018}, | ||
| publisher={Nature Publishing Group} | ||
| }""" |
There was a problem hiding this comment.
@kvfairchild we're beginning to duplicate this BIBTEX quite a lot, e.g. in data/pereira2018 and benchmarks/pereira2018. One simple solution might be to replace the benchmarks definitions with from brainscore_language.data.pereira2018 import BIBTEX, is that acceptable from a plugin perspective? I guess we might run into import errors if dependencies are not installed and potentially encourage direct imports when we want plugins to go through the plugin manager.
| @@ -0,0 +1,135 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Shouldn't this just replace the current pereira2018? I would say we don't want a new file, but rather want to make this the new version.
Tagging @kvfairchild so she can chime in from the plugins perspective.
| def __init__( | ||
| self, | ||
| experiment: str, | ||
| # ceiling_s3_kwargs: dict = None, |
| }, | ||
| ) | ||
| identifier = f"Pereira2018.{experiment}-linreg_pearsonr" | ||
| # ceiling = self._load_ceiling(identifier=identifier, **ceiling_s3_kwargs) |
|
|
||
| from brainscore_language import data_registry | ||
|
|
||
| # from brainscore_language.utils.s3 import load_from_s3 |
| @@ -0,0 +1,23 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Let's talk about whether this goes into its own file or is part of the existing pereira2018 data plugin (I put a note on the agenda)
| # inv_neuroid_map = {v: k for k, v in neuroid_id_map} | ||
| # inv_presentation_map = {v: k for k, v in presentation_id_map} |
There was a problem hiding this comment.
feeling less strongly about it here, but still: dead code :)
| def upload_data_assembly(assembly, assembly_identifier, bucket_name): | ||
| # adapted from | ||
| # https://github.com/mschrimpf/brainio/blob/8a40a3558d0b86072b9e221808f19005c7cb8c17/brainio/packaging.py#L217 | ||
|
|
||
| _logger.debug(f"Uploading {assembly_identifier} to S3") | ||
|
|
||
| # identifiers | ||
| assembly_store_identifier = "assembly_" + assembly_identifier.replace(".", "_") | ||
| netcdf_file_name = assembly_store_identifier + ".nc" | ||
| target_netcdf_path = ( | ||
| Path(fetch.get_local_data_path()) / assembly_store_identifier / netcdf_file_name | ||
| ) | ||
| s3_key = netcdf_file_name | ||
|
|
||
| # write to disk and upload | ||
| netcdf_kf_sha1 = write_netcdf(assembly, target_netcdf_path) | ||
| _logger.debug(f"Wrote file to {target_netcdf_path}.") | ||
| # upload_to_s3(target_netcdf_path, bucket_name, s3_key) | ||
| # _logger.debug( | ||
| # f"Uploaded assembly {assembly_identifier} to S3: {s3_key} (SHA1 hash {netcdf_kf_sha1})" | ||
| # ) |
There was a problem hiding this comment.
can just reuse
language/brainscore_language/utils/s3.py
Line 12 in b03ea2c
|
|
||
| assert ( | ||
| len(set(assembly["neuroid"].values)) == 120 | ||
| ) # potential TODO: rename to neuroid_id |
|
@aalok-sathe any updates on this PR? |
|
should we be concerned by this (warning?) message? we encounter it at during ceiling computation and aren't sure if this is an issue.our assembly contains subject as a coord but not as a dimension (subject is never a dimension, right? it is along the neuroid dimension?)
|
|
We're also looking for some help towards this failure of the test; now that we uploaded to s3 we're not sure why it's failing to find the assembly file in the cache: https://app.travis-ci.com/github/brain-score/language/builds/255739587#L660 |
No -- this is just saying that it cannot select on the score's
At least in the build you linked, it's trying to load the file from local disk rather than S3: |
I think we changed that in the latest commit we pushed yesterday: |
| data_registry["Pereira2018_v2022.language"] = lambda: load_from_s3( | ||
| identifier="Pereira2018ROI", | ||
| version_id="8kEzAXaWnxjMIC95MrhSJ3gtP2a1W.Y7", | ||
| sha1="235ecf1f2abc38cb892c0a7b5c9c465434f153c5", | ||
| ) |
There was a problem hiding this comment.
@aalok-sathe I set the S3 object to public, but I think the issue is that you're attempting to load assy_Pereira2018ROI while the S3 file is called assembly_Pereira2018ROI -- if you pass assembly_prefix='assembly' to load_from_s3, I believe it should work
language/brainscore_language/utils/s3.py
Line 33 in 5ea01ce
It already shows up as a DEBUG message. But I don't think we understand why it would occur there in the first place? In tracks to a brainio script where there is even no "isel" operation? |
|
Sorry, this PR was closed after combining commit history. @aalok-sathe can you please open a new PR? I'm afraid the simplest solution is to 1. checkout the branch locally, 2. copy all files into a separate location, 3. checkout main, 4. update main, 5. create a new branch, 6. copy all files back again overwriting the files in main, 7. push and open a PR. |
|
No worries! will do!
…________________________________
From: Martin Schrimpf ***@***.***>
Sent: Tuesday, 25 October, 2022, 23:11
To: brain-score/language ***@***.***>
Cc: Aalok | आलोक ***@***.***>; Mention ***@***.***>
Subject: Re: [brain-score/language] towards adding Pereira2018ROI as a benchmark (PR #37)
Sorry, this PR was closed after combining commit history. @aalok-sathe<https://github.com/aalok-sathe> can you please open a new PR?
|
the data file is local for now; not available on s3. We'll share the csv in slack.
this contains means of ROIs for Lang for all subjects, averaged across sessions.