forked from viorik/ConvLSTM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecoder.lua
More file actions
21 lines (17 loc) · 791 Bytes
/
decoder.lua
File metadata and controls
21 lines (17 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'nn'
-- Decoder, mirror of the encoder, but no non-linearity
-- first layer
decoder = nn.Sequential()
--decoder:add(nn.SpatialUpSamplingNearest(2))
--decoder:add(nn.SpatialConvolution(opt.nFilters[3], opt.nFilters[2], opt.kernelSize, opt.kernelSize, 1, 1, opt.padding, opt.padding))
--decoder:add(nn.Diag(opt.nFilters[2]))
-- second layer
--decoder:add(nn.Dropout(0.5))
--decoder:add(nn.SpatialUnPooling(2))
decoder:add(nn.SpatialUpSamplingNearest(2))
local conv = nn.Sequential()
conv:add(nn.SpatialConvolution(opt.nFilters[2], opt.nFilters[1], opt.kernelSize, opt.kernelSize, 1, 1, opt.padding, opt.padding))
local conv_new = require('weight-init')(conv, 'xavier')
decoder:add(conv_new)
--decoder:add(nn.SpatialUpSamplingNearest(2))
--decoder:add(nn.Diag(opt.nFilters[1]))