in lib/models/conv.py [0:0]
def __init__(self, n_in, n_out, n_filters=128, activation='relu', batchnorm=True):
super(DCGAN64_Generator, self).__init__()
self.n_in = n_in
self.deconv1 = nn.ConvTranspose2d(n_in, n_filters*8, 4, 1, 0)
self.deconv1_bn = nn.BatchNorm2d(n_filters*8)
self.deconv2 = nn.ConvTranspose2d(n_filters*8, n_filters*4, 4, 2, 1)
self.deconv2_bn = nn.BatchNorm2d(n_filters*4)
self.deconv3 = nn.ConvTranspose2d(n_filters*4, n_filters*2, 4, 2, 1)
self.deconv3_bn = nn.BatchNorm2d(n_filters*2)
self.deconv4 = nn.ConvTranspose2d(n_filters*2, n_filters, 4, 2, 1)
self.deconv4_bn = nn.BatchNorm2d(n_filters)
self.deconv5 = nn.ConvTranspose2d(n_filters, n_out, 4, 2, 1)
if activation == 'relu':
self.activation = F.relu
elif activation == 'lrelu':
self.activation = lambda x: F.leaky_relu(x, 0.2)
else:
raise ValueError()
self.batchnorm = batchnorm