def get_loader(self, name, transfs): assert name in self.data_splits dataset = FolderDataset(self.data_splits[name], load_func=self.load_func, transforms=transfs) return data.DataLoader(dataset=dataset, **self.loader_params, collate_fn=self.pad_seq)
def get_loader(self, name, transforms): """ 数据载入方法 :param transforms: 对数据做随机变换 :param name: 'train' or 'val' :return: data.DataLoader() """ assert name in self.data_splits dataset = FolderDataset(self.data_splits[name], transforms=transforms) return data.DataLoader(dataset=dataset, **self.loader_params)
def get_loader(self, name): assert name in self.data dataset = FolderDataset(self.data[name]) return data.DataLoader(dataset=dataset, **self.loader_params, collate_fn=self.pad_seq)