(self, x)
| 40 | self.cat_head = nn.Linear(d_model, 3) |
| 41 | |
| 42 | def forward(self, x): |
| 43 | x = x.squeeze(1) |
| 44 | # transpose |
| 45 | x = x.permute(0, 2, 1) |
| 46 | x = self.embed(x) |
| 47 | |
| 48 | # transformer encoder |
| 49 | x = self.transformer_encoder(x) |
| 50 | |
| 51 | # mean pool for classification |
| 52 | x = torch.mean(x, dim=1) |
| 53 | |
| 54 | logits = self.cat_head(x) |
| 55 | return logits |
nothing calls this directly
no outgoing calls
no test coverage detected