Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate training data for spectrogram
def build_training_data(batch_size, sample_size):
xs = np.random.randn(batch_size, sample_size)
f, t, ys = spectrogram(xs)
(num_rows, num_cols) = (ys.shape[1], ys.shape[2])
ys = ys.reshape(batch_size, num_rows * num_cols)
Ys = np.hstack([ys.real, ys.imag])
return (xs, Ys, num_rows, num_cols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment