MCPcopy Create free account
hub / github.com/AggieSportsAnalytics/CourtCheck / forward

Method forward

backend/models/stroke_detector.py:51–61  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

49 self.fc = nn.Linear(hidden_size, num_classes)
50
51 def forward(self, x):
52 # x shape is (batch_size, seq_len, input_size)
53 h0, c0 = self.init_state(x.size(0))
54 output, (hn, cn) = self.LSTM(x, (h0, c0))
55 # size = 1
56 size = x.size(1) // 4
57
58 output = output[:, -size:, :]
59 scores = self.fc(output.squeeze(0))
60 # scores shape is (batch_size, num_classes)
61 return scores
62
63 def init_state(self, batch_size):
64 return (

Callers

nothing calls this directly

Calls 1

init_stateMethod · 0.95

Tested by

no test coverage detected