MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __init__

Method __init__

PATH/core/models/necks/attention.py:127–136  ·  view source on GitHub ↗
(self, channel=512, reduction=16, use_cls_token=False)

Source from the content-addressed store, hash-verified

125class SEAttention(nn.Module):
126
127 def __init__(self, channel=512, reduction=16, use_cls_token=False):
128 super().__init__()
129 self.avg_pool = nn.AdaptiveAvgPool2d(1)
130 self.fc = nn.Sequential(
131 nn.Linear(channel, channel // reduction, bias=False),
132 nn.ReLU(inplace=True),
133 nn.Linear(channel // reduction, channel, bias=False),
134 nn.Sigmoid()
135 )
136 self.use_cls_token = use_cls_token
137
138 def init_weights(self):
139 for m in self.modules():

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected