Last active
March 21, 2017 00:20
-
-
Save airalcorn2/42123581b69813e2bdac6afe8ef9fc5c to your computer and use it in GitHub Desktop.
Visualize filters from: https://jgeekstudies.org/2017/03/12/who-is-that-neural-network/.
This file contains 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
kernels = model.layers[0].get_weights()[0].T | |
(rows, cols) = (8, 4) | |
plt.figure(figsize = (16, 24)) | |
gs = gridspec.GridSpec(rows, cols, wspace = 0.1, hspace = 0.1) | |
for i in range(kernels.shape[0]): | |
row = i // cols | |
col = i % cols | |
ax = plt.subplot(gs[row, col]) | |
plt.axis("off") | |
plt.imshow(kernels[i].T) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment