Created
May 27, 2015 12:05
-
-
Save pratikac/810f5487d03c2e13272c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_model() | |
local m = nn:Sequential() | |
m:add(cudnn.SpatialConvolution(1, 32, 5, 5)) | |
m:add(cudnn.ReLU(true)) | |
m:add(cudnn.SpatialMaxPooling(3,3,3,3)) | |
m:add(cudnn.SpatialConvolution(32, 64, 5, 5)) | |
m:add(cudnn.ReLU(true)) | |
m:add(cudnn.SpatialMaxPooling(2,2,2,2)) | |
m:add(nn.View(64*2*2)) | |
m:add(nn.Dropout(opt.dropout)) | |
m:add(nn.Linear(64*2*2, 256)) | |
m:add(cudnn.ReLU(true)) | |
m:add(nn.Dropout(opt.dropout)) | |
m:add(nn.Linear(256, 256)) | |
m:add(nn.ReLU(true)) | |
m:add(nn.Linear(256, #classes)) | |
m:add(nn.LogSoftMax()) | |
local cost_function = nn.ClassNLLCriterion() | |
return m, cost_function | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment