Skip to content

Instantly share code, notes, and snippets.

@0xfe
Created March 2, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xfe/bd8db7b878cbef048543e58d850bab67 to your computer and use it in GitHub Desktop.
Save 0xfe/bd8db7b878cbef048543e58d850bab67 to your computer and use it in GitHub Desktop.
Keras model for training spectrogram NN
import tensorflow as tf
size = 2048
N = 15000
(xs, ys, rows, cols) = build_training_data(N, size)
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(rows * cols * 2, input_dim=size, use_bias=False)
])
model.summary()
optimizer = tf.keras.optimizers.Adam(amsgrad=True)
model.compile(loss='mean_squared_error', optimizer=optimizer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment