MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / __init__

Method __init__

models/modules/attentions.py:8–14  ·  view source on GitHub ↗
(self, channels, reduction=16)

Source from the content-addressed store, hash-verified

6
7class SEWeightModule(nn.Module):
8 def __init__(self, channels, reduction=16):
9 super(SEWeightModule, self).__init__()
10 self.avg_pool = nn.AdaptiveAvgPool2d(1)
11 self.fc1 = nn.Conv2d(channels, channels//reduction, kernel_size=1, padding=0)
12 self.relu = nn.ReLU(inplace=True)
13 self.fc2 = nn.Conv2d(channels//reduction, channels, kernel_size=1, padding=0)
14 self.sigmoid = nn.Sigmoid()
15
16 def forward(self, x):
17 out = self.avg_pool(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected