MCPcopy Create free account
hub / github.com/NVlabs/SPADE / forward

Method forward

models/networks/normalization.py:96–110  ·  view source on GitHub ↗
(self, x, segmap)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected