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

Method __init__

timm/models/layers/cbam.py:99–106  ·  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

97
98class LightCbamModule(nn.Module):
99 def __init__(
100 self, channels, rd_ratio=1./16, rd_channels=None, rd_divisor=1,
101 spatial_kernel_size=7, act_layer=nn.ReLU, gate_layer='sigmoid', mlp_bias=False):
102 super(LightCbamModule, self).__init__()
103 self.channel = LightChannelAttn(
104 channels, rd_ratio=rd_ratio, rd_channels=rd_channels,
105 rd_divisor=rd_divisor, act_layer=act_layer, gate_layer=gate_layer, mlp_bias=mlp_bias)
106 self.spatial = LightSpatialAttn(spatial_kernel_size)
107
108 def forward(self, x):
109 x = self.channel(x)

Callers

nothing calls this directly

Calls 3

LightChannelAttnClass · 0.85
LightSpatialAttnClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected