#%% from torch.utils.data import DataLoader from icae.tools.dataset.single import SingleWaveformDataset, SingleWaveformPreprocessing from icae.tools.torch.gym import Gym from icae.models.waveform.simple import ConvAE # %% raise NotImplementedError() dataset = SingleWaveformDataset(load_waveform_only=False,transform=SingleWaveformPreprocessing(),batch_loading_size=64) train = DataLoader(dataset, shuffle=True, batch_size=1,num_workers=1) # TODO: check performanc #%% %%timeit for i,j in zip(train,range(1000)): pass # %% # %%
#%% filename = config.root + config.MC.filename device = torch.device("cuda") dl_config = { "batch_size": 32 * 10, "num_workers": 12, "shuffle": True, # "collate_fn": MCDataset.collate_fn, "pin_memory": True, } dataset_train = MCDataset(filename=filename, key="train/waveforms", transform=SingleWaveformPreprocessing()) dataset_val = MCDataset(filename=filename, key="val/waveforms", transform=SingleWaveformPreprocessing()) train = DataLoader(dataset_train, **dl_config) val = DataLoader(dataset_val, batch_size=1024, num_workers=12) #%% runs = TrainingStability("Ribbles_w_outliers_1e6", None) runs.load() #%% def argmedian(array): return np.argsort(array)[len(array) // 2]