【问题标题】:Visualize images in intermediate layers in torch (lua)在 Torch (lua) 中可视化中间层中的图像
【发布时间】:2015-10-09 04:29:19
【问题描述】:

在conv-nets模型中,我知道如何可视化过滤器,我们可以做itorch.image(model:get(1).weight)

但是我怎样才能有效地可视化卷积后的输出图像呢?尤其是深度神经网络中第二层或第三层的那些图像?

谢谢。

【问题讨论】:

  • 第二个答案更合适,请重新选择答案,这样更容易找到更好更正确的答案

标签: image lua data-visualization convolution torch


【解决方案1】:

类似于重量,你可以使用:

itorch.image(model:get(1).output)

【讨论】:

  • 谢谢!让我试试看。
【解决方案2】:

可视化权重:

-- visualizing weights
n = nn.SpatialConvolution(1,64,16,16)
itorch.image(n.weight)

要可视化特征图:

-- initialize a simple conv layer
n = nn.SpatialConvolution(1,16,12,12)

-- push lena through net :)
res = n:forward(image.rgb2y(image.lena())) 

-- res here is a 16x501x501 volume. We view it now as 16 separate sheets of size 1x501x501 using the :view function
res = res:view(res:size(1), 1, res:size(2), res:size(3))
itorch.image(res)

更多:https://github.com/torch/tutorials/blob/master/1_get_started.ipynb

【讨论】:

    猜你喜欢
    • 2015-12-15
    • 2016-09-30
    • 2015-07-03
    • 2016-02-15
    • 2016-09-28
    • 2019-08-15
    • 2017-07-27
    • 2016-03-24
    • 1970-01-01
    相关资源
    最近更新 更多