MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / __init__

Method __init__

timm/models/layers/cbam.py:83–90  ·  view source on GitHub ↗
(
            self, channels, rd_ratio=1./16, rd_channels=None, rd_divisor=1,
            spatial_kernel_size=7, act_layer=nn.ReLU, gate_layer='sigmoid', mlp_bias=False)

Source from the content-addressed store, hash-verified

81
82class CbamModule(nn.Module):
83 def __init__(
84 self, channels, rd_ratio=1./16, rd_channels=None, rd_divisor=1,
85 spatial_kernel_size=7, act_layer=nn.ReLU, gate_layer='sigmoid', mlp_bias=False):
86 super(CbamModule, self).__init__()
87 self.channel = ChannelAttn(
88 channels, rd_ratio=rd_ratio, rd_channels=rd_channels,
89 rd_divisor=rd_divisor, act_layer=act_layer, gate_layer=gate_layer, mlp_bias=mlp_bias)
90 self.spatial = SpatialAttn(spatial_kernel_size, gate_layer=gate_layer)
91
92 def forward(self, x):
93 x = self.channel(x)

Callers 5

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

Calls 2

ChannelAttnClass · 0.85
SpatialAttnClass · 0.85

Tested by

no test coverage detected