| 278 | return x |
| 279 | |
| 280 | class 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 | |
| 299 | class OneShotDataset(Dataset): |
| 300 | def __init__(self, original_dataset): |
nothing calls this directly
no outgoing calls
no test coverage detected