MCPcopy Create free account
hub / github.com/RolandGao/RegSeg / __init__

Method __init__

competitor_blocks.py:12–25  ·  view source on GitHub ↗
(self, in_channels, out_channels=128, sizes=(1, 2, 3, 6))

Source from the content-addressed store, hash-verified

10 Zhao, Hengshuang, et al. *"Pyramid scene parsing network."*
11 """
12 def __init__(self, in_channels, out_channels=128, sizes=(1, 2, 3, 6)):
13 super(PSPModule, self).__init__()
14
15 convs = []
16 for size in sizes:
17 convs.append(
18 nn.Sequential(
19 nn.AdaptiveAvgPool2d(output_size=(size, size)),
20 ConvBnAct(in_channels,out_channels,apply_act=False)
21 )
22 )
23 self.stages=nn.ModuleList(convs)
24 self.bottleneck=ConvBnAct(in_channels+len(sizes)*out_channels,out_channels)
25 self.dropout=nn.Dropout2d(0.1)
26
27 def forward(self, x):
28 y=[x]

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

ConvBnActClass · 0.90

Tested by

no test coverage detected