def __init__(self, root_dir, transform=None, name_as_tag=True, binarize=True): """ Args: root_dir (string): Directory with all the csv transform (callable, optional): Optional transform to be applied on a sample. """ super(pianoroll_dataset_batch, self).__init__() self.root_dir = root_dir self.transform = transform if(name_as_tag): self.tags = datp.load_all_dataset_names(self.root_dir) self.tags_ids=dict(zip(np.unique(self.tags),range(np.unique(self.tags).size))) self.data = datp.load_all_dataset(self.root_dir,binarize)
def __init__(self, root_dir,transform=None,binarize=True,delta=1): """ Args: root_dir (string): Directory with all the csv transform (callable, optional): Optional transform to be applied on a sample. """ super(pianoroll_dataset_chunks, self).__init__() self.root_dir = root_dir self.transform = transform self.tags = datp.load_all_dataset_names(self.root_dir) self.tags_ids=dict(zip(np.unique(self.tags),range(np.unique(self.tags).size))) self.fulldata = datp.load_all_dataset(self.root_dir,binarize) self.fulldata = tuple(self.convert_fulldata(i,delta) for i in range(len(self.tags))) self.indexes = [(0,0)]