def __init__(self): ceiling = Score([1, np.nan], coords={'aggregation': ['center', 'error']}, dims=['aggregation']) assembly_repetition = get_assembly() assert len(np.unique(assembly_repetition['region'])) == 1 assert hasattr(assembly_repetition, 'repetition') self.region = 'IT' self.assembly = average_repetition(assembly_repetition) self._assembly = self.assembly self.timebins = timebins_from_assembly(self.assembly) self._similarity_metric = CrossRegressedCorrelation( regression=pls_regression(), correlation=pearsonr_correlation(), crossvalidation_kwargs=dict( stratification_coord=Split.Defaults.stratification_coord if hasattr(self.assembly, Split.Defaults.stratification_coord ) else None)) identifier = f'{assembly_repetition.name}-layer_selection' ceiler = InternalConsistency() super(_MockBenchmark, self).__init__(identifier=identifier, ceiling_func=lambda: ceiler(assembly_repetition), version='1.0')
def load_assembly(average_repetitions): assembly = brainscore.get_assembly(name='aru.Kuzovkin2018') if average_repetitions: assembly = average_repetition(assembly) # assembly.reset_index('time', drop=True, inplace=True) return assembly
def load_assembly(average_repetitions): assembly = brainscore.get_assembly(name='aru.Cichy2019') # fix the off by 1 error with the stimulus set # assembly = assembly['image_id'] + 1 if average_repetitions: assembly = average_repetition(assembly) return assembly
def load_assembly(average_repetitions, region, access='private'): assembly = brainscore.get_assembly(name=f'dicarlo.Majaj2015.{access}') assembly = assembly.sel(region=region) assembly['region'] = 'neuroid', [region] * len(assembly['neuroid']) assembly = assembly.squeeze("time_bin") assembly.load() assembly = assembly.transpose('presentation', 'neuroid') if average_repetitions: assembly = average_repetition(assembly) return assembly
def load_assembly(average_repetitions, region): assembly = brainscore.get_assembly(name=f'dicarlo.Rajalingham2020') assembly = assembly.sel(region=region) assembly['region'] = 'neuroid', [region] * len(assembly['neuroid']) assembly.load() assembly = assembly.squeeze('time_bin') assert NUMBER_OF_TRIALS == len(np.unique(assembly.coords['repetition'])) if average_repetitions: assembly = average_repetition(assembly) return assembly
def load_assembly(average_repetitions, region): assembly = brainscore.get_assembly(name=f'dicarlo.Sanghavi2020') assembly = assembly.sel(region=region) assembly['region'] = 'neuroid', [region] * len(assembly['neuroid']) assembly.load() assembly = assembly.sel(time_bin_id=0) # 70-170ms assembly = assembly.squeeze('time_bin') assert NUMBER_OF_TRIALS == len(np.unique(assembly.coords['repetition'])) assert VISUAL_DEGREES == assembly.attrs['image_size_degree'] if average_repetitions: assembly = average_repetition(assembly) return assembly
def load_assembly(average_repetitions, region, access='private'): assembly = brainscore.get_assembly(f'movshon.FreemanZiemba2013.{access}') assembly = assembly.sel(region=region) assembly = assembly.stack( neuroid=['neuroid_id']) # work around xarray multiindex issues assembly['region'] = 'neuroid', [region] * len(assembly['neuroid']) assembly.load() time_window = (50, 200) assembly = assembly.sel(time_bin=[(t, t + 1) for t in range(*time_window)]) assembly = assembly.mean(dim='time_bin', keep_attrs=True) assembly = assembly.expand_dims('time_bin_start').expand_dims( 'time_bin_end') assembly['time_bin_start'], assembly['time_bin_end'] = [time_window[0]], [ time_window[1] ] assembly = assembly.stack(time_bin=['time_bin_start', 'time_bin_end']) assembly = assembly.squeeze('time_bin') assembly = assembly.transpose('presentation', 'neuroid') if average_repetitions: assembly = average_repetition(assembly) return assembly