def plot_filters(net, layer, x, y):
 filters = net.layers[layer].w.eval()
 fig = plt.figure()
 for j in range(len(filters)):
  ax = fig.add_subplot(y, x, j)
  ax.matshow(filters[j][0], cmap=matplotlib.cm.binary)
  plt.xticks(np.array([]))
  plt.yticks(np.array([]))
 plt.tight_layout()
 return plt

def plot_filters ( net , layer , x , y ) : filters = net . layers [ layer ] . w . eval ( ) fig = plt . figure ( ) for j in range ( len ( filters ) ) : ax = fig . add_subplot ( y , x , j ) ax . matshow ( filters [ j ] [ 0 ] , cmap = matplotlib . cm . binary ) plt . xticks ( np . array ( [ ] ) ) plt . yticks ( np . array ( [ ] ) ) plt . tight_layout ( ) return plt
plot the filters for net after the layer number layer .