将矩阵转换为图像 [不是 RGB] 及其含义

Converting Matrix to Image [not RGB] and what it means

我想在使用 VGG 模型时查看各种中间层的输出(只是为了好玩)。

所以在卷积运算之后你会得到这样的结果 (?,28,28,512):

  1. ?对于通过的图像数量
  2. 28*28是卷积运算后的维度和
  3. 512 是提供的过滤器数量。

我想看看各种输出是什么样子的 [0,:,:,25] 的例子,所以在 link to convert an array into image. Now my question is what kind of image is this exactly if not an RGB cause when i see the image there definitely are some blue,green color.

中使用了这个方法

编辑:- 我一直在使用的代码:-

req_model = Model(inputs=base_model.input, outputs=base_model.get_layer('block4_conv2 ').output) vpred = req_model.predict(img) ## np.shape(vpred) == (1,28,28,512) plt.imshow(vpred[0,:,:,12])

长话短说;博士 在我的例子中,形状为 28*28 的图像究竟意味着什么[我以为我会看到黑白的东西],如果这不是正确的方式,我希望得到一些指导。

如果您使用 matplotlib 绘制图像,那么它看起来像 Viridis 颜色图。更多 here.