Skip to content

Change metric name "linear" to "linreg_pearsonr" - #68

Closed
gretatuckute wants to merge 509 commits into
mainfrom
gretatu-linear-metric-changes
Closed

gretatuckute wants to merge 509 commits into
mainfrom
gretatu-linear-metric-changes

Conversation

@gretatuckute

Copy link
Copy Markdown
Contributor

Change metric name "linear" to "linreg_pearsonr" given that the linear metric consists of linear regression with pearson correlation. We want to be able to create benchmarks that use different evaluation metrics and hence need naming conventions to support this.

Changed this for the metric names, but did not change the Pereira Class name (_Pereira2018ExperimentLinear) and the ceiling identifier (identifier = f'Pereira2018.{experiment}-linear'). @mschrimpf do you want to change these too such that it matches this convention (I did not want to change it to not mess up loading of ceilings/data).

aalok-sathe and others added 30 commits March 25, 2022 14:51
… default even without specifying it in metadata (ref. #18)
…ing packaged dataset. also no longer silently overwrite using to_netcdf(). instead show a warning and then overwrite.
…cheable`. all classes we want to be able to cache and recover from cache must subclass this interface
kvfairchild and others added 16 commits August 22, 2022 21:43
* restructure huggingface helper

* restructure Futrell2018

* remove __init__.py files to discourage direct imports

* restructure pereira2018

* restructure wikitext, fedorenko2016, and blank2014

* rename plugin pools to `<type>_registry`

`datasets` -> `data_registry`
`metrics` -> `metric_registry`
`benchmarks` -> `benchmark_registry`
`models` -> `model_registry`

* update plugin runner for directory restructure  (#52)

* update plugin paths

* typo fix

* add bibtex

* unique namespace for plugins

* nix relative import

* update plugin name

* Update brainscore_language/benchmarks/pereira2018/benchmark.py

* Update brainscore_language/utils/plugins/test_plugins.py

* update plugin tests path

* add `models`

Co-authored-by: Martin Schrimpf <[email protected]>

* uplevel plugins

* reflect dir restructuring

* update plugins test instructions

* update paths

Co-authored-by: Katherine Fairchild <[email protected]>
Co-authored-by: Martin Schrimpf <[email protected]>

* rename {data,metric,benchmark}.py --> __init__.py

* rename plugins -> plugin_management

otherwise users might expect that the plugins/ folder contains the actual plugins

* autoformat; fix `self.plugin_env_path`

* use `bash` to `run_plugin.sh`

to avoid PermissionDenied error

* nitty oxford comma

Co-authored-by: kvfairchild <[email protected]>
Co-authored-by: Katherine Fairchild <[email protected]>
* ues cross entropy (rather than perplexity) to estimate reading times

* use bits instead of nats

following @hans's comment #55 (comment)

* pass in all preceding context to compute reading times

* adapt tests to context processing

* remove -1, keep reading times positive

* task head options; separate representation function; trim whitespaces for next-word

* separate `_setup_hooks` method

* note that implementation can also be used for sentence reading times (sum over word surprisals)

* minor comment fixes

* fix typo in test

* add more edge-case tests for RT task

* output NaN when first input region is just one token, and so there is no defined RT

* exclude first word reading times from comparison

* update single-word reading time to nan, and per-sequence

* absolute instead of relative imports

Co-authored-by: Jon Gauthier <[email protected]>
* add specific gpt2 model instances

* restructure directories following #50

* adapt to #55
* simplify __main__.py and .gitignore

* absolute import

* reset .gitignore to how it was
* copy Glove implementation from neural-nlp

https://github.com/mschrimpf/neural-nlp/blob/cedac1f868c8081ce6754ef0c13895ce8bc32efc/neural_nlp/models/implementations.py

* adapt GloVe to ArtificialSubject using Gensim wrapper

* automatically download weights

* fix import

* add tests README describing markers

from https://github.com/brain-score/brain-score/blob/5e43c9495eb3de93bfc12ab6b2421c66ef4f4fc4/tests/README.md

* mark glove test as travis_slow

* remove redundant prints

* use glove.txt directly, do away with word2vec conversion
* test dummy failure in pereira

* typo fix

* collect results from all plugin tests

* add results list

* Remove dummy error

* POSIX compliance (add EOF blank line)

* relative import

* Update brainscore_language/plugin_management/test_plugins.py

Co-authored-by: Martin Schrimpf <[email protected]>

* absolute import

* ignore flagged tests

* update plugin results

* set errors to exit status 1

* cleanup

Co-authored-by: Katherine Fairchild <[email protected]>
Co-authored-by: Martin Schrimpf <[email protected]>
Co-authored-by: Katherine Fairchild <[email protected]>
`context` in NLP is usually used for the entire history, or all preceding context, not just the current stimulus
* add test for long inputs; truncate accordingly in tokenizer

also move next-word prediction tests first

* implement cuda support in huggingface wrapper

* remove tqdm addition

* fix truncation from left

* concat outputs along `presentation` instead of merge

concat is much faster because we do not need to infer shapes first

* extract tokenization method, keep track of overflow

* fix approx test

* get rid of `numel` assertion to avoid confusion
* setup for model-benchmark integration tests

* mark as slow; update score

* use `score` method; add Pereira2018

* add Glove on Pereira2018
* add test_examples script

from https://github.com/brain-score/brain-score/blob/5e43c9495eb3de93bfc12ab6b2421c66ef4f4fc4/tests/test_examples.py

* delete examples test script (using docs for now)

* add benchmark tutorial

* add newlines to render code blocks

* add newline to render list

* yet another missing newline

* a wild newline appeared

* update identifier example to `'benchmarkid-metricid'`

* fix italics

* add model tutorial

* add imports

* fix Pereira2018 data packaging link

* attempt to clarify `parse_experiment_data`

* clarify score in metric
@mschrimpf

Copy link
Copy Markdown
Member

Changed this for the metric names, but did not change the Pereira Class name (_Pereira2018ExperimentLinear) and the ceiling identifier (identifier = f'Pereira2018.{experiment}-linear'). @mschrimpf do you want to change these too such that it matches this convention (I did not want to change it to not mess up loading of ceilings/data).

happy to change the ceiling name if you prefer! let me know.

@gretatuckute

gretatuckute commented Sep 19, 2022 •

Copy link
Copy Markdown
Contributor Author

Changed this for the metric names, but did not change the Pereira Class name (_Pereira2018ExperimentLinear) and the ceiling identifier (identifier = f'Pereira2018.{experiment}-linear'). @mschrimpf do you want to change these too such that it matches this convention (I did not want to change it to not mess up loading of ceilings/data).

happy to change the ceiling name if you prefer! let me know.

Ok, thanks -- yes, that'd be great. Also, do you want to change the class name too?

@mschrimpf

Copy link
Copy Markdown
Member

Changed this for the metric names, but did not change the Pereira Class name (_Pereira2018ExperimentLinear) and the ceiling identifier (identifier = f'Pereira2018.{experiment}-linear'). @mschrimpf do you want to change these too such that it matches this convention (I did not want to change it to not mess up loading of ceilings/data).

happy to change the ceiling name if you prefer! let me know.

Ok, thanks -- yes, that'd be great. Also, do you want to change the class name too?

up to you, I'm happy to leave as-is, but if you're going to introduce linear non-pearson benchmarks on the same data, it should probably be changed

@mschrimpf

Copy link
Copy Markdown
Member

@gretatuckute any updates on this PR?

@gretatuckute

gretatuckute commented Oct 12, 2022 •

Copy link
Copy Markdown
Contributor Author

I thought this was all set and resolved, no? We have changed the linreg nomenclature in the branch where we update the Pereira benchmarks. This should be merged?

@mschrimpf

Copy link
Copy Markdown
Member

Unit tests are failing though, e.g. in brainscore_language/benchmarks/pereira2018/test.py:54 (TestBenchmark.test_dummy_bad): KeyError: 'Pereira2018.243sentences-linear' (from load_benchmark(f'Pereira2018.{experiment}sentences-linear'))

@mschrimpf

mschrimpf commented Oct 26, 2022 •

Copy link
Copy Markdown
Member

Sorry, this PR was closed after combining commit history. @gretatuckute 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.

@gretatuckute

Copy link
Copy Markdown
Contributor Author

Sorry, this PR was closed after combining commit history. @gretatuckute 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.

Hm, I think we might want to merge these edits with the "towards adding Pereira2018ROI as a benchmark #37" PR because that was the reason the units tests were failing.

@aalok-sathe

Copy link
Copy Markdown
Member

I think most of these edits are already incorporated into the former PR #37 (although not specifically by way of the commits on this PR). So when that gets merged, they will automatically make their way. The alternative is we merge this into main independently and merge main into the former #37.
What do you think is preferable?

@gretatuckute

Copy link
Copy Markdown
Contributor Author

I think most of these edits are already incorporated into the former PR #37 (although not specifically by way of the commits on this PR). So when that gets merged, they will automatically make their way. The alternative is we merge this into main independently and merge main into the former #37. What do you think is preferable?

I think the big merge is preferable

@mschrimpf
mschrimpf deleted the gretatu-linear-metric-changes branch November 8, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants