Skip to content

Instantly share code, notes, and snippets.

@mrubash1
Created March 22, 2017 21:56
Show Gist options
  • Save mrubash1/4e4f36daac2968cd12e8eeba2113843a to your computer and use it in GitHub Desktop.
Save mrubash1/4e4f36daac2968cd12e8eeba2113843a to your computer and use it in GitHub Desktop.
RNN Tutorial - Gist 1
class DataSet:
def __init__(self, txt_files, thread_count, batch_size, numcep, numcontext):
# ...
def from_directory(self, dirpath, start_idx=0, limit=0, sort=None):
return txt_filenames(dirpath, start_idx=start_idx, limit=limit, sort=sort)
def next_batch(self, batch_size=None):
idx_list = range(_start_idx, end_idx)
txt_files = [_txt_files[i] for i in idx_list]
wav_files = [x.replace('.txt', '.wav') for x in txt_files]
# Load audio and text into memory
(audio, text) = get_audio_and_transcript(txt_files,
wav_files,
_numcep,
_numcontext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment