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

Method __init__

models/networks.py:496–511  ·  view source on GitHub ↗
(self, in_layer=4, gpu_ids=[], nc=256, patch_num=256, dim=64, init_type='normal', init_gain=0.02)

Source from the content-addressed store, hash-verified

494
495class MappingF(nn.Module):
496 def __init__(self, in_layer=4, gpu_ids=[], nc=256, patch_num=256, dim=64, init_type='normal', init_gain=0.02):
497 # hard-coded code.
498 super().__init__()
499 self.init_type = init_type
500 self.nc=nc
501 self.dim=dim
502 self.in_layer=in_layer
503 self.patch_num = patch_num
504 self.init_type = init_type
505 self.init_gain = init_gain
506 self.gpu_ids = gpu_ids
507 avg = nn.AdaptiveAvgPool2d(1)
508 conv = nn.Conv2d(in_layer, dim, 3, stride=2)
509 self.model = nn.Sequential(*[conv, nn.ReLU(), avg, nn.Flatten(), nn.Linear(dim,dim), nn.ReLU(), nn.Linear(dim, dim)])
510 init_net(self.model, self.init_type, self.init_gain, self.gpu_ids)
511 self.l2norm = Normalize(2)
512
513 def forward(self, x):
514 x = x.view(1, -1, self.patch_num, self.nc)

Callers

nothing calls this directly

Calls 3

init_netFunction · 0.85
NormalizeClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected