Skip to content

Instantly share code, notes, and snippets.

@0xfe
Created March 2, 2020 16:42
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/af81df7faaae90a217e2a48b5251b63a to your computer and use it in GitHub Desktop.
Save 0xfe/af81df7faaae90a217e2a48b5251b63a to your computer and use it in GitHub Desktop.
Peek into NN layers
weights_sxx = model.get_weights()[0]
weights_sxx = np.reshape(weights_sxx, (size, rows * 2, cols))
weights_sxx = np.moveaxis(weights_sxx, (0,1,2), (2,1,0))
plt.figure(figsize=(12, 7))
plt.subplot(2, 2, 1)
plt.pcolormesh(weights_sxx[0], cmap="Accent")
plt.subplot(2, 2, 2)
plt.pcolormesh(weights_sxx[10], cmap="Accent")
plt.subplot(2, 2, 3)
plt.pcolormesh(weights_sxx[20], cmap="Accent")
plt.subplot(2, 2, 4)
plt.pcolormesh(weights_sxx[30], cmap="Accent")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment