MCPcopy Create free account
hub / github.com/NineAbyss/ZeroG / alignMLP

Class alignMLP

code/utils.py:280–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278 return x
279
280class alignMLP(nn.Module):
281 def __init__(self, input_dim, hidden_dim, output_dim):
282 super(alignMLP, self).__init__()
283 self.layer1 = nn.Linear(input_dim, hidden_dim)
284 self.layer2 = nn.Linear(hidden_dim, hidden_dim)
285 self.layer3 = nn.Linear(hidden_dim, hidden_dim)
286 self.layer4 = nn.Linear(hidden_dim, hidden_dim)
287 self.layer5 = nn.Linear(hidden_dim, output_dim)
288 self.norm = nn.LayerNorm(output_dim)
289
290 def forward(self, x):
291 x = F.gelu(self.layer1(x))
292 x = F.gelu(self.layer2(x))
293 x = F.gelu(self.layer3(x))
294 x = F.gelu(self.layer4(x))
295 x = self.layer5(x)
296 x = self.norm(x)
297 return x
298
299class OneShotDataset(Dataset):
300 def __init__(self, original_dataset):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected