| 48 | |
| 49 | |
| 50 | class FFN(torch.nn.Module): |
| 51 | def __init__(self, input_features, hidden_size, bias=True): |
| 52 | super().__init__() |
| 53 | self.fc1 = torch.nn.Linear(input_features, hidden_size, bias=bias) |
| 54 | self.fc2 = torch.nn.Linear(hidden_size, input_features, bias=bias) |
| 55 | |
| 56 | with torch.no_grad(): |
| 57 | torch.nn.init.xavier_uniform_(self.fc1.weight) |
| 58 | torch.nn.init.xavier_uniform_(self.fc2.weight) |
| 59 | |
| 60 | def forward(self, x): |
| 61 | x = torch.relu(self.fc1(x)) |
| 62 | x = self.fc2(x) |
| 63 | return x |
| 64 | |
| 65 | |
| 66 | class Timer: |
nothing calls this directly
no outgoing calls
no test coverage detected