forked from Atcold/torch-Video-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.lua
40 lines (32 loc) · 782 Bytes
/
script.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- qlua -lenv
torch.manualSeed(0)
net = require '3conv-pool'
require 'image'
x = image.scale(image.lena(), 256, 256)
= #x
image.display{image = x, legend = 'img'}
= #net:forward(x)
-- qlua
= net:get(1)
-- th
net:get(1)
{net:get(1)}
-- Input / output planes
-- Stride
-- Kernel size
-- Check size of output
-- Check size of kernel / gradKernel
-- Check size of bias / gradBias
image.display{image = net:get(1).weight, legend = 'k(1)', zoom = 18, padding = 2}
function show(x, t)
print(x)
image.display{image = x.output, legend = t, scaleeach=true}
end
show(net:get(1), 'y(1)')
show(net:get(2), 'y(1)+')
show(net:get(3), 'y(2)')
show(net:get(4), 'y(2)+')
show(net:get(5), 'pool[y(2)+]')
show(net:get(6), 'y(3)')
show(net:get(7), 'y(3)+')
show(net:get(8), 'pool[y(3)+]')