Skip to content

Instantly share code, notes, and snippets.

@mirth
Created August 27, 2020 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirth/5591d1b6d8da2142d8d85c4ed31a179f to your computer and use it in GitHub Desktop.
Save mirth/5591d1b6d8da2142d8d85c4ed31a179f to your computer and use it in GitHub Desktop.
class NoiseDataSet(Dataset):
def __init__(self, X, y):
super().__init__()
assert(len(X) == len(y))
self.X = X
self.y = y
def __len__(self):
return len(self.X)
def __getitem__(self, idx):
filename = self.X[idx]
wav = wavfile_to_examples(filename)
wav = wav.cuda()
target = self.y[idx]
return wav, target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment