Created
March 2, 2020 16:30
-
-
Save 0xfe/0da873c4ee32ff1bbb5d22b9f0b49817 to your computer and use it in GitHub Desktop.
Generate training data for spectrogram
This file contains hidden or 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
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]) | |
print(ys.shape) | |
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