MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / FeedForward

Class FeedForward

sat/sgm/modules/encoders/traj_encoder.py:31–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 return emb
30
31class FeedForward(nn.Module):
32 def __init__(self, dim, hidden_dim, dropout = 0.):
33 super().__init__()
34 self.net = nn.Sequential(
35 nn.LayerNorm(dim),
36 nn.Linear(dim, hidden_dim),
37 nn.GELU(),
38 nn.Dropout(dropout),
39 nn.Linear(hidden_dim, dim),
40 nn.Dropout(dropout)
41 )
42 def forward(self, x):
43 return self.net(x)
44
45class Attention(nn.Module):
46 def __init__(self, dim, heads = 8, dim_head = 64, dropout = 0.):

Callers 1

__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected