Created
July 27, 2016 18:01
-
-
Save bmcfee/98f4eef1aa6d05637d7d772d8b705cc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
import pescador | |
def data_sampler(filename, n_samples): | |
# Load all the data from the file, somehow | |
data = load_data(filename) | |
for n in range(n_samples): | |
x, y = sample(data) | |
yield dict(x=x, y=y) | |
stream = pescador.Streamer(data_sampler, n_samples=128) | |
streamer = pescador.zmq_stream(stream) | |
for sample in steamer: | |
process(sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
e.g. sample: pick up the data for this batch
x
=audio file,y
=label, andprocess
= librosa.stft?