在火炬(lua)中可视化中间层中的图像

Jam*_*mes 5 lua data-visualization image convolution torch

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

但是如何在卷积后有效地可视化输出图像?尤其是深层神经网络中第二层或第三层的图像?

谢谢.

小智 13

与体重相似,您可以使用:

itorch.image(model:get(1).output)
Run Code Online (Sandbox Code Playgroud)


anh*_*ng8 5

要显示权重:

-- visualizing weights
n = nn.SpatialConvolution(1,64,16,16)
itorch.image(n.weight)
Run Code Online (Sandbox Code Playgroud)

要可视化要素图:

-- 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)
Run Code Online (Sandbox Code Playgroud)

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