MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / __init__

Method __init__

segmentation/backbones/cgnet.py:27–36  ·  view source on GitHub ↗
(self, channel, reduction=16, with_cp=False)

Source from the content-addressed store, hash-verified

25 """
26
27 def __init__(self, channel, reduction=16, with_cp=False):
28 super(GlobalContextExtractor, self).__init__()
29 self.channel = channel
30 self.reduction = reduction
31 assert reduction >= 1 and channel >= reduction
32 self.with_cp = with_cp
33 self.avg_pool = nn.AdaptiveAvgPool2d(1)
34 self.fc = nn.Sequential(
35 nn.Linear(channel, channel // reduction), nn.ReLU(inplace=True),
36 nn.Linear(channel // reduction, channel), nn.Sigmoid())
37
38 def forward(self, x):
39

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected