def display_convw2(w, s, r, c, fig, title='conv_filters'):
  """w: num_filters X sizeX**2 * num_colors."""
  num_f, num_d = w.shape
  assert s**2 * 3 == num_d
  pvh = np.zeros((s*r, s*c, 3))
  for i in range(r):
    for j in range(c):
      pvh[i*s:(i+1)*s, j*s:(j+1)*s, :] = w[i*c + j, :].reshape(3, s, s).T
  mx = pvh.max()
  mn = pvh.min()
  pvh = 255*(pvh - mn) / (mn-mx)
  pvh = pvh.astype('uint8')
  plt.figure(fig)
  plt.suptitle(title)
  plt.imshow(pvh, interpolation="nearest")
  scale = 1
  xmax = s * c
  ymax = s * r
  color = 'k'
  for x in range(0, c):
    plt.axvline(x=x*s/scale, ymin=0, ymax=ymax/scale, color=color)
  for y in range(0, r):
    plt.axhline(y=y*s/scale, xmin=0, xmax=xmax/scale, color=color)
  plt.draw()
  return pvh
dataset/ETHPy150Open nitishsrivastava/deepnet/deepnet/visualize.py/display_convw2/swapped operands of `-`