MCPcopy Create free account
hub / github.com/JunlinHan/DCLGAN / __init__

Method __init__

models/networks.py:722–735  ·  view source on GitHub ↗
(self, n_upsample, n_res, dim, output_dim, norm='batch', activ='relu', pad_type='zero', nz=0)

Source from the content-addressed store, hash-verified

720
721class Decoder_all(nn.Module):
722 def __init__(self, n_upsample, n_res, dim, output_dim, norm='batch', activ='relu', pad_type='zero', nz=0):
723 super(Decoder_all, self).__init__()
724 # AdaIN residual blocks
725 self.resnet_block = ResBlocks(n_res, dim, norm, activ, pad_type=pad_type, nz=nz)
726 self.n_blocks = 0
727 # upsampling blocks
728 for i in range(n_upsample):
729 block = [Upsample2(scale_factor=2), Conv2dBlock(dim + nz, dim // 2, 5, 1, 2, norm='ln', activation=activ, pad_type='reflect')]
730 setattr(self, 'block_{:d}'.format(self.n_blocks), nn.Sequential(*block))
731 self.n_blocks += 1
732 dim //= 2
733 # use reflection padding in the last conv layer
734 setattr(self, 'block_{:d}'.format(self.n_blocks), Conv2dBlock(dim + nz, output_dim, 7, 1, 3, norm='none', activation='tanh', pad_type='reflect'))
735 self.n_blocks += 1
736
737 def forward(self, x, y=None):
738 if y is not None:

Callers

nothing calls this directly

Calls 4

ResBlocksClass · 0.85
Upsample2Class · 0.85
Conv2dBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected