(self, x, segmap)
| 94 | self.mlp_beta = nn.Conv2d(nhidden, norm_nc, kernel_size=ks, padding=pw) |
| 95 | |
| 96 | def forward(self, x, segmap): |
| 97 | |
| 98 | # Part 1. generate parameter-free normalized activations |
| 99 | normalized = self.param_free_norm(x) |
| 100 | |
| 101 | # Part 2. produce scaling and bias conditioned on semantic map |
| 102 | segmap = F.interpolate(segmap, size=x.size()[2:], mode='nearest') |
| 103 | actv = self.mlp_shared(segmap) |
| 104 | gamma = self.mlp_gamma(actv) |
| 105 | beta = self.mlp_beta(actv) |
| 106 | |
| 107 | # apply scale and bias |
| 108 | out = normalized * (1 + gamma) + beta |
| 109 | |
| 110 | return out |
nothing calls this directly
no outgoing calls
no test coverage detected