MCPcopy Create free account
hub / github.com/ChunmingHe/WS-SAM / getAlpha

Class getAlpha

lib/Modules.py:475–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473
474
475class getAlpha(nn.Module):
476 def __init__(self, in_channels):
477 super(getAlpha, self).__init__()
478 self.avg_pool = nn.AdaptiveAvgPool2d(1)
479 self.max_pool = nn.AdaptiveMaxPool2d(1)
480 self.fc1 = nn.Conv2d(in_channels*2,in_channels,kernel_size =1, bias=False)
481 self.relu1 = nn.ReLU()
482 self.fc2 = nn.Conv2d(in_channels,1, 1, bias=False)
483 self.sigmoid = nn.Sigmoid()
484
485 def forward(self, x):
486 avg_out = self.fc2(self.relu1(self.fc1(self.avg_pool(x))))
487 max_out = self.fc2(self.relu1(self.fc1(self.max_pool(x))))
488 out = avg_out + max_out
489 return self.sigmoid(out)
490
491
492class ODE(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected