Skip to content

Instantly share code, notes, and snippets.

@0xfe
Created March 2, 2020 18:48
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/89a0c10da18fef15602af5b2d59a66d6 to your computer and use it in GitHub Desktop.
Save 0xfe/89a0c10da18fef15602af5b2d59a66d6 to your computer and use it in GitHub Desktop.
Plot weights of FFT NN model
def plot_weights(index, weights=model.get_weights()[0], N=fft_size):
plt.figure(figsize=(9, 3))
plt.subplot(1, 2, 1)
plt.plot(weights[index][:N])
plt.plot(weights[index][N:], 'g-')
plt.subplot(1, 2, 2)
plt.plot(weights[fft_size+index][:N])
plt.plot(weights[fft_size+index][N:], 'g-')
plt.show()
for index in [((2**n) - 1) for n in range(0, 5)]:
plot_weights(index)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment