Skip to content

Instantly share code, notes, and snippets.

@airalcorn2
Last active March 21, 2017 00:20
Show Gist options
  • Save airalcorn2/42123581b69813e2bdac6afe8ef9fc5c to your computer and use it in GitHub Desktop.
Save airalcorn2/42123581b69813e2bdac6afe8ef9fc5c to your computer and use it in GitHub Desktop.
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