MCPcopy
hub / github.com/PaddlePaddle/PaddleGAN / __init__

Method __init__

ppgan/modules/first_order.py:320–346  ·  view source on GitHub ↗
(self,
                 block_expansion,
                 in_features,
                 num_blocks=3,
                 max_features=256,
                 mobile_net=False)

Source from the content-addressed store, hash-verified

318 Hourglass Encoder
319 """
320 def __init__(self,
321 block_expansion,
322 in_features,
323 num_blocks=3,
324 max_features=256,
325 mobile_net=False):
326 super(Encoder, self).__init__()
327
328 down_blocks = []
329 for i in range(num_blocks):
330 if mobile_net:
331 down_blocks.append(
332 MobileDownBlock2d(in_features if i == 0 else min(
333 max_features, block_expansion * (2**i)),
334 min(max_features,
335 block_expansion * (2**(i + 1))),
336 kernel_size=3,
337 padding=1))
338 else:
339 down_blocks.append(
340 DownBlock2d(in_features if i == 0 else min(
341 max_features, block_expansion * (2**i)),
342 min(max_features,
343 block_expansion * (2**(i + 1))),
344 kernel_size=3,
345 padding=1))
346 self.down_blocks = nn.LayerList(down_blocks)
347
348 def forward(self, x):
349 outs = [x]

Callers 11

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

MobileDownBlock2dClass · 0.85
appendMethod · 0.80
DownBlock2dClass · 0.70

Tested by

no test coverage detected