Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brain-score.org submission (user:461) | (public:False) #1402

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions brainscore_vision/data/DataGenerationTrial_emogan/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from brainio.assemblies import NeuronRecordingAssembly
from brainscore_vision import load_stimulus_set
from brainscore_vision import stimulus_set_registry, data_registry
from brainscore_vision.data_helpers.s3 import load_assembly_from_s3, load_stimulus_set_from_s3

stimulus_set_registry["DataGenerationTrial_emogan"] = lambda: load_stimulus_set_from_s3(
identifier="DataGenerationTrial_emogan",
bucket="brainio-brainscore",
csv_version_id="Qq7dNhtGWMyVlLllhmsMam7qSjzxDsSR",
csv_sha1="3cb3dd389fc6397d75af0445564cf7ce10ce33ce",
zip_version_id="f6BQWLIMj9dr6g4ehV1dzVdSvUeYpMql",
zip_sha1="4e9bc6f15993ae652445ed53b0ec235448a932fd",
filename_prefix='stimulus_',
)

data_registry["DataGenerationTrial_emogan"] = lambda: load_assembly_from_s3(
identifier="DataGenerationTrial_emogan",
version_id="mmrwu.hRTxkCLZAGxQlI1QWgVZxcKCMY",
sha1="a962aa6975e9bad1032136a135167d2832f0db13",
bucket="brainio-brainscore",
cls=NeuronRecordingAssembly,
stimulus_set_loader=lambda: load_stimulus_set('DataGenerationTrial_emogan'),
)


Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from brainio.packaging import package_stimulus_set, package_data_assembly
from brainscore_vision import load_dataset, load_stimulus_set

def upload_stimulus_set_to_s3(stimuli):
return package_stimulus_set(catalog_name=None, proto_stimulus_set=stimuli,
stimulus_set_identifier=stimuli.name, bucket_name="brainio-brainscore")

def upload_assembly_to_s3(assembly):
return package_data_assembly(None, assembly, assembly_identifier=assembly.name,
stimulus_set_identifier=assembly.name,
assembly_class_name="NeuronRecordingAssembly",
bucket_name="brainio-brainscore")


if __name__ == '__main__':
ss = load_stimulus_set('DataGenerationTrial_emogan')
assembly = load_dataset('DataGenerationTrial_emogan')


23 changes: 23 additions & 0 deletions brainscore_vision/data/DataGenerationTrial_emogan/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest

from brainscore_vision import load_dataset, load_stimulus_set
from brainscore_vision.benchmark_helpers import check_standard_format


@pytest.mark.memory_intense
@pytest.mark.private_access
def test_assembly():
assembly = load_dataset('DataGenerationTrial_emogan')
check_standard_format(assembly, nans_expected=True)
assert assembly.attrs['stimulus_set_identifier'] == 'DataGenerationTrial_emogan'
assert set(assembly['region'].values) == {'IT'}
assert len(assembly['presentation']) == 8500
assert len(assembly['neuroid']) == 18


@pytest.mark.private_access
def test_stimulus_set():
stimulus_set = load_stimulus_set('DataGenerationTrial_emogan')
assert len(stimulus_set) == 170