MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / forward

Method forward

models/iTransformer/itransformer.py:42–55  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected