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

Method __init__

models/networks.py:694–705  ·  view source on GitHub ↗
(self, n_downsample, n_res, input_dim, dim, norm, activ, pad_type='zero')

Source from the content-addressed store, hash-verified

692
693class ContentEncoder(nn.Module):
694 def __init__(self, n_downsample, n_res, input_dim, dim, norm, activ, pad_type='zero'):
695 super(ContentEncoder, self).__init__()
696 self.model = []
697 self.model += [Conv2dBlock(input_dim, dim, 7, 1, 3, norm=norm, activation=activ, pad_type='reflect')]
698 # downsampling blocks
699 for i in range(n_downsample):
700 self.model += [Conv2dBlock(dim, 2 * dim, 4, 2, 1, norm=norm, activation=activ, pad_type='reflect')]
701 dim *= 2
702 # residual blocks
703 self.model += [ResBlocks(n_res, dim, norm=norm, activation=activ, pad_type=pad_type)]
704 self.model = nn.Sequential(*self.model)
705 self.output_dim = dim
706
707 def forward(self, x, nce_layers=[], encode_only=False):
708 if len(nce_layers) > 0:

Callers

nothing calls this directly

Calls 3

Conv2dBlockClass · 0.85
ResBlocksClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected