Skip to content

Commit

Permalink
+info about SpectrogramDatasetWithLength
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorLakomkin committed Jun 14, 2017
1 parent b0370d0 commit 09d06d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/bucketing_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

class SpectrogramDatasetWithLength(SpectrogramDataset):
def __init__(self, *args, **kwargs):
"""
SpectrogramDataset that splits utterances into buckets based on their length.
Bucketing is done via numpy's histogram method.
Used by BucketingSampler to sample utterances from the same bin.
"""
super(SpectrogramDatasetWithLength, self).__init__(*args, **kwargs)
audio_paths = [path for (path, _) in self.ids]
audio_lengths = [len(load_audio(path)) for path in audio_paths]
Expand Down

0 comments on commit 09d06d7

Please sign in to comment.