def composite_dataset(dataset="objectome24", threshold=12000, mongo_reload=False): if dataset == "objectome24": collections = ["objectome64", "objectome_imglvl", "ko_obj24_basic_2ways", "monkobjectome"] meta = obj.objectome24_meta() elif dataset == "hvm10": collections = [ "hvm10_basic_2ways", "hvm10_allvar_basic_2ways", ] # , 'hvm10_basic_2ways_newobj', 'hvm10-finegrain'] meta = obj.hvm10_meta() fns = ["sample_obj", "id", "dist_obj", "choice", "WorkerID"] col_data = () for col in collections: dset = obj.psychophysDatasetObject(col, {}, meta, mongo_reload=mongo_reload) col_data = col_data + (dset.trials,) trials = tb.rowstack(col_data) # segregate into pool and individuals workers = trials["WorkerID"] col_data_seg = {"all": trials, "pool": ()} for uw in np.unique(workers): tw = np.nonzero([w == uw for w in workers])[0] if len(tw) < threshold: col_data_seg["pool"] = col_data_seg["pool"] + (trials[tw],) else: col_data_seg[uw] = trials[tw] col_data_seg["pool"] = tb.rowstack(col_data_seg["pool"]) return col_data_seg
def get_model_data(dataset="objectome24"): if dataset == "objectome24": featurespath = "/mindhive/dicarlolab/u/rishir/stimuli/objectome24s100/features/" meta = obj.objectome24_meta() all_metas, all_features = {}, {} # f_oi = ['ALEXNET_fc6', 'ALEXNET_fc8', 'RESNET101_conv5', 'VGG_fc6', 'VGG_fc8', 'ALEXNET_fc7', 'GOOGLENET_pool5', 'V1', 'VGG_fc7'] f_oi = ["RESNET101_conv5"] for f in f_oi: data = np.load(featurespath + f + ".npy") all_features[f] = data all_metas[f] = meta return obj.testFeatures(all_features, all_metas, f_oi, obj.models_combined24)