'normalize': False, 'resize_to': (128, 128)}, {'crop': None, 'dtype': 'float32', 'mask': None, 'mode': 'L', 'normalize': False, 'resize_to': (128, 128)}] M = np.random.rand(20, 20) ytest = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9] mean_performance(M) label_variance(M, ytest) y = dataset.meta['synset'] # X = P[:] # may have to memmap this splits = get_subset_splits(dataset.meta, npc_train=150, npc_tests=[50], num_splits=1, catfunc=lambda x: x['synset']) split = splits[0][0] # # # dtype='float32', mode='w+', shape=memmap_shape) # return np.memmap(filename, 'float32', 'w+')) for i, preproc in enumerate(preprocs): P = dataset.get_pixel_features(preproc) Xtrain = np.memmap(filename='train_memmap_'+str(i)+'.dat', dtype='float32', mode='w+', shape=(len(split['train']), P.shape[1])) Xtest = np.memmap(filename='test_memmap_'+str(i)+'.dat', dtype='float32', mode='w+', shape=(len(split['test']), P.shape[1])) Xtrain[:] = P[split['train']]
def get_subset_splits(self, *args, **kwargs): return get_subset_splits(self.meta, *args, **kwargs)