Skip to content

Commit

Permalink
minor rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
gaohuang committed Aug 23, 2017
1 parent e684f0a commit 6d4c8da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion models/DenseConnectLayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ function DenseConnectLayerStandard(nChannels, opt)
net:add(cudnn.SpatialConvolution(nChannels, opt.growthRate, 3, 3, 1, 1, 1, 1))
if opt.dropRate > 0 then net:add(nn.Dropout(opt.dropRate)) end

return net
return nn.Sequential()
:add(nn.Concat(2)
:add(nn.Identity())
:add(net))
end

--------------------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions models/densenet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ local function createModel(opt)
if opt.optMemory >= 3 then
model:add(nn.DenseConnectLayerCustom(nChannels, opt))
else
model:add(nn.Concat(2)
:add(nn.Identity())
:add(DenseConnectLayerStandard(nChannels, opt)))
model:add(DenseConnectLayerStandard(nChannels, opt))
end
end

Expand Down

0 comments on commit 6d4c8da

Please sign in to comment.