MCPcopy Create free account
hub / github.com/RolnickLab/climart / forward

Method forward

climart/models/modules/additional_layers.py:30–43  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

28 self.gap = GAP()
29
30 def forward(self, x):
31 x_3 = self.multi_3(x)
32 x_5 = self.multi_5(x)
33 x_7 = self.multi_7(x)
34 x_3 = F.adaptive_max_pool1d(x_3, self.out_shape)
35 x_5 = F.adaptive_max_pool1d(x_5, self.out_shape)
36 x_7 = F.adaptive_max_pool1d(x_7, self.out_shape)
37 x_concat = torch.cat((x_3, x_5, x_7), 1)
38 x_concat = self.after_concat(x_concat)
39
40 if self.use_act:
41 return torch.sigmoid(self.gap(x)) * x_concat
42 else:
43 return x_concat
44
45
46class GAP():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected