MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / __init__

Method __init__

open_loop_training/code/model_code/backbones/lss.py:122–135  ·  view source on GitHub ↗
(self,
                 in_features,
                 hidden_features=None,
                 out_features=None,
                 act_layer=nn.ReLU,
                 drop=0.0)

Source from the content-addressed store, hash-verified

120
121class Mlp(nn.Module):
122 def __init__(self,
123 in_features,
124 hidden_features=None,
125 out_features=None,
126 act_layer=nn.ReLU,
127 drop=0.0):
128 super().__init__()
129 out_features = out_features or in_features
130 hidden_features = hidden_features or in_features
131 self.fc1 = nn.Linear(in_features, hidden_features)
132 self.act = act_layer()
133 self.drop1 = nn.Dropout(drop)
134 self.fc2 = nn.Linear(hidden_features, out_features)
135 self.drop2 = nn.Dropout(drop)
136
137 def forward(self, x):
138 x = self.fc1(x)

Callers 7

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected