MCPcopy Create free account
hub / github.com/bingchenlll/FastGAN-pytorch / DownBlockComp

Class DownBlockComp

models.py:196–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196class DownBlockComp(nn.Module):
197 def __init__(self, in_planes, out_planes):
198 super(DownBlockComp, self).__init__()
199
200 self.main = nn.Sequential(
201 conv2d(in_planes, out_planes, 4, 2, 1, bias=False),
202 batchNorm2d(out_planes), nn.LeakyReLU(0.2, inplace=True),
203 conv2d(out_planes, out_planes, 3, 1, 1, bias=False),
204 batchNorm2d(out_planes), nn.LeakyReLU(0.2)
205 )
206
207 self.direct = nn.Sequential(
208 nn.AvgPool2d(2, 2),
209 conv2d(in_planes, out_planes, 1, 1, 0, bias=False),
210 batchNorm2d(out_planes), nn.LeakyReLU(0.2))
211
212 def forward(self, feat):
213 return (self.main(feat) + self.direct(feat)) / 2
214
215
216class Discriminator(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected