blob: a797a9f438fe153a720ddc16c154d6473609a360 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
-- Reference: http://jmlr.org/proceedings/papers/v28/goodfellow13.pdf
local Maxout, parent = torch.class('nn.Maxout', 'nn.Sequential')
function Maxout:__init(inputSize, outputSize, maxoutNumber, preprocess)
parent.__init(self)
self:add(nn.Linear(inputSize, outputSize * maxoutNumber))
self:add(nn.View(maxoutNumber, outputSize):setNumInputDims(1))
if preprocess then
self:add(preprocess)
end
self:add(nn.Max(1, 2))
end
|