MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / SE3d

Class SE3d

modules/se.py:8–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 def forward(self,x):
7 return x * torch.sigmoid(x)
8class SE3d(nn.Module):
9 def __init__(self, channel, reduction=8, use_relu=False):
10 super().__init__()
11 self.fc = nn.Sequential(
12 nn.Linear(channel, channel // reduction, bias=False),
13 nn.ReLU(True) if use_relu else Swish() ,
14 nn.Linear(channel // reduction, channel, bias=False),
15 nn.Sigmoid()
16 )
17
18 def forward(self, inputs):
19 return inputs * self.fc(inputs.mean(-1).mean(-1).mean(-1)).view(inputs.shape[0], inputs.shape[1], 1, 1, 1)

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected