MCPcopy Create free account
hub / github.com/geekcomputers/Python / forward

Method forward

ML/src/python/neuralforge/nn/modules.py:160–165  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

158 self.fc2 = nn.Linear(channels // reduction, channels)
159
160 def forward(self, x):
161 b, c, _, _ = x.size()
162 se = x.mean([2, 3])
163 se = F.relu(self.fc1(se))
164 se = torch.sigmoid(self.fc2(se))
165 return x * se.view(b, c, 1, 1)
166
167class SpatialAttention(nn.Module):
168 def __init__(self, kernel_size=7):

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected