My goal is to predict whether a shot is hit or not by the trajectory of the basketball (there are already papers that do the same, I m just reproducing them (https://arxiv.org/abs/1608.03793)). It s a very simple problem, but for some other purpose I want to try lstm s prediction. But the network was not only slow to converge but start overfitting very quickly. A time series has a length of 12 and a feature dimension of 4 (x,y,z coordinates and time)
class PolicyHead(nn.Layer):
def __init__(self):
super(PolicyHead, self).__init__()
self.lstm = LSTM(4,64,2,dropout=0.3)
self.fc = nn.Linear(64,2)
def forward(self, past_traj):
b,n,c = past_traj.shape
return self.fc(self.lstm(past_traj, batch_id))
相比之下,使用了非常简单的乳房结构,预测非常好。
class PolicyHead(nn.Layer):
def __init__(self):
super(PolicyHead, self).__init__()
self.fc = nn.Sequential(
nn.Linear(12*4, 512),
nn.ReLU(),
nn.Linear(512,512),
nn.ReLU(),
nn.Linear(512,2)
)
def forward(self, past_traj):
b,n,c = past_traj.shape
return self.fc(past_traj.reshape([b,-1]))