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
model_G = nn.Sequential() | |
model_G:add(nn.JoinTable(2, 2)) | |
model_G:add(cudnn.SpatialConvolutionUpsample(3+1, 64, 7, 7, 1, 1)):add(cudnn.ReLU(true)) | |
model_G:add(nn.SpatialBatchNormalization(64, nil, nil, false)) | |
model_G:add(cudnn.SpatialConvolutionUpsample(64, 368, 7, 7, 1, 4)):add(cudnn.ReLU(true)) | |
model_G:add(nn.SpatialBatchNormalization(368, nil, nil, false)) | |
model_G:add(nn.SpatialDropout(0.5)) | |
model_G:add(cudnn.SpatialConvolutionUpsample(368, 128, 7, 7, 1, 4)):add(cudnn.ReLU(true)) | |
model_G:add(nn.SpatialBatchNormalization(128, nil, nil, false)) | |
model_G:add(nn.FeatureLPPooling(2,2,2,true)) |
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
---------------------------------------------------------------------- | |
-- CIFAR 8x8 | |
opt.scale = 8 | |
opt.geometry = {3, opt.scale, opt.scale} | |
local input_sz = opt.geometry[1] * opt.geometry[2] * opt.geometry[3] | |
local numhid = 600 | |
model_D = nn.Sequential() | |
model_D:add(nn.Reshape(input_sz)) | |
model_D:add(nn.Linear(input_sz, numhid)) | |
model_D:add(nn.ReLU()) |