aggtamv commited on
Commit
fae0184
·
1 Parent(s): 168f439

Deploy NBA predictor model

Browse files
Files changed (3) hide show
  1. model.pth +3 -0
  2. model.py +25 -0
  3. requirements.txt +5 -0
model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae3e35b43ef43691a02474f97e68538a6b3bef0a2b0d6c68666eb1ce7292426f
3
+ size 3351857
model.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # model.py
2
+ import torch
3
+ import torch.nn as nn
4
+ import torch.nn.functional as F
5
+
6
+ class LSTMModel(nn.Module):
7
+ def __init__(self, input_size):
8
+ super(LSTMModel, self).__init__()
9
+ hidden1 = 64
10
+ hidden2 = 256
11
+ self.lstm1 = nn.LSTM(input_size=input_size, hidden_size=hidden1, batch_first=True, dropout=0.2, bidirectional=True)
12
+ self.ln1 = nn.LayerNorm(hidden1 * 2)
13
+ self.lstm2 = nn.LSTM(input_size=hidden1 * 2, hidden_size=hidden2, batch_first=True, dropout=0.2, bidirectional=True)
14
+ self.ln2 = nn.LayerNorm(hidden2 * 2)
15
+ self.fc = nn.Linear(hidden2 * 2, 1)
16
+
17
+ def forward(self, x):
18
+ x, _ = self.lstm1(x)
19
+ x = self.ln1(x)
20
+ x = F.relu(x)
21
+ x, _ = self.lstm2(x)
22
+ x = self.ln2(x)
23
+ x = F.relu(x)
24
+ out = self.fc(x[:, -1, :])
25
+ return out
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ torch
2
+ gradio
3
+ numpy
4
+ scikit-learn
5
+ pandas