MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / MLP

Class MLP

models/decoders/MLPDecoder.py:9–21  ·  view source on GitHub ↗

Linear Embedding:

Source from the content-addressed store, hash-verified

7
8
9class MLP(nn.Module):
10 """
11 Linear Embedding:
12 """
13
14 def __init__(self, input_dim=2048, embed_dim=768):
15 super().__init__()
16 self.proj = nn.Linear(input_dim, embed_dim)
17
18 def forward(self, x):
19 x = x.flatten(2).transpose(1, 2)
20 x = self.proj(x)
21 return x
22
23
24class DecoderHead(nn.Module):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected