I am trying to predict the trajectory of an object over time using LSTM. I have three different configurations of training and predicting values in my mind and I would like to know what the best solution to this problem might be (I would also appreciate insights regarding these approaches).
1) Many to one (loss is the MSE of a single value)
- The $input$ is a sequence of $n$ values, the output is the prediction of the single value at position $n+1$.
- The loss function is the MSE of the predicted value and its real value (so, corresponding to the value in position $n+1$).
- During the online test, a sequence of $n$ values predict one value ($n+1$), and this value is concatenated to the previous sequence in order to predict the next value ($n+2$) etc.. This way, a whole trajectory of $n + t$ values is calculated.
2) Many to one (loss is MSE of multiple values)
- The $input$ is a sequence of $n$ values, the output is the prediction of the single value at position $n+1$.
- To compute the loss function, the same strategy used before for online test is applied. LSTM predicts one value, this value is concatenated and used to predict the successive value $t$ times. The loss is the MSE of all the predicted values in the trajectory and their real values. Backpropagation is only done when the whole trajectory has been predicted.
- Online testing is equal to the previous situation.
3) Many to many
- The $input$ is a sequence of $n$ values, the output is the prediction of $m$ consecutive values.
- The loss function is the MSE of the $m$ predictions and their corresponding ground truth.