MCPcopy Create free account
hub / github.com/InternRobotics/P3Former / MLP

Class MLP

p3former/decode_heads/p3former_head.py:163–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161 return new_queries
162
163class MLP(nn.Module):
164 def __init__(self, channels):
165 super().__init__()
166 self.mlp = nn.ModuleList()
167 for cc in range(len(channels) - 2):
168 self.mlp.append(
169 nn.Sequential(
170 nn.Linear(
171 channels[cc],
172 channels[cc + 1],
173 bias=False),
174 build_norm_layer(
175 dict(type='LN'), channels[cc + 1])[1],
176 build_activation_layer(
177 dict(type='GELU'))))
178 self.mlp.append(
179 nn.Linear(channels[-2], channels[-1]))
180
181 def forward(self, input):
182 for layer in self.mlp:
183 input = layer(input)
184 return input
185
186@MODELS.register_module()
187class _P3FormerHead(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected