MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / __init__

Method __init__

models/net_utils.py:10–20  ·  view source on GitHub ↗
(self, dim, reduction=1)

Source from the content-addressed store, hash-verified

8# Feature Rectify Module
9class ChannelWeights(nn.Module):
10 def __init__(self, dim, reduction=1):
11 super(ChannelWeights, self).__init__()
12 self.dim = dim
13 self.avg_pool = nn.AdaptiveAvgPool2d(1)
14 self.max_pool = nn.AdaptiveMaxPool2d(1)
15 self.mlp = nn.Sequential(
16 nn.Linear(self.dim * 4, self.dim * 4 // reduction),
17 nn.ReLU(inplace=True),
18 nn.Linear(self.dim * 4 // reduction, self.dim * 2),
19 nn.Sigmoid(),
20 )
21
22 def forward(self, x1, x2):
23 B, _, H, W = x1.shape

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected