MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / forward

Method forward

lib/decoders.py:159–175  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

157 named_apply(partial(_init_weights, scheme=scheme), self)
158
159 def forward(self, x):
160 pout1 = self.pconv1(x)
161 msdc_outs = self.msdc(pout1)
162 if self.add == True:
163 dout = 0
164 for dwout in msdc_outs:
165 dout = dout + dwout
166 else:
167 dout = torch.cat(msdc_outs, dim=1)
168 dout = channel_shuffle(dout, gcd(self.combined_channels,self.out_channels))
169 out = self.pconv2(dout)
170 if self.use_skip_connection:
171 if self.in_channels != self.out_channels:
172 x = self.conv1x1(x)
173 return x + out
174 else:
175 return out
176
177# Multi-scale convolution block (MSCB)
178def MSCBLayer(in_channels, out_channels, n=1, stride=1, kernel_sizes=[1,3,5], expansion_factor=2, dw_parallel=True, add=True, activation='relu6'):

Callers

nothing calls this directly

Calls 2

channel_shuffleFunction · 0.85
gcdFunction · 0.85

Tested by

no test coverage detected