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

Method __init__

lib/Modules.py:667–677  ·  view source on GitHub ↗
(self, channel, reduction=16)

Source from the content-addressed store, hash-verified

665
666class CALayer(nn.Module):
667 def __init__(self, channel, reduction=16):
668 super(CALayer, self).__init__()
669 # global average pooling: feature --> point
670 self.avg_pool = nn.AdaptiveAvgPool2d(1)
671 # feature channel downscale and upscale --> channel weight
672 self.conv_du = nn.Sequential(
673 nn.Conv2d(channel, channel // reduction, 1, padding=0, bias=True),
674 nn.ReLU(inplace=True),
675 nn.Conv2d(channel // reduction, channel, 1, padding=0, bias=True),
676 nn.Sigmoid()
677 )
678
679 def forward(self, x):
680 y = self.avg_pool(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected