Skip to content

Instantly share code, notes, and snippets.

@saurabhpal97
Last active April 17, 2019 13:25
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 saurabhpal97/8e6c484546beeb167363bc690fb3ca41 to your computer and use it in GitHub Desktop.
Save saurabhpal97/8e6c484546beeb167363bc690fb3ca41 to your computer and use it in GitHub Desktop.
layers = model.layers
layer_ids = [1,4,7,11,15]
#plot the filters
fig,ax = plt.subplots(nrows=1,ncols=5)
for i in range(5):
ax[i].imshow(layers[layer_ids[i]].get_weights()[0][:,:,:,0][:,:,0],cmap='gray')
ax[i].set_title('block'+str(i+1))
ax[i].set_xticks([])
ax[i].set_yticks([])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment