The number of network parameters for TFT and LSTM (maybe other models as well) does not change when changing either max_encoder_length and/or max_prediction_length in the TimeSeriesDataSet class.
For the calculation of the number of network parameters I used the implementation of PyTorch Forecasting and verified it with the standard pytorch implementation to calculate the number of network parameters.
For TFT (min_encoder_length = max_encoder_length; min_prediction_length = max_prediction_length):
By default TFT.max_encoder_length = TimeSeriesDataSet.max_encoder_length if not set default=10.
TFT.max_encoder_length can be set to a higher value than TimeSeriesDataSet.max_encoder_length, but not smaller.
A change of the value for either TimeSeriesDataSet.max_encoder_length or TFT.max_encoder_length does not change the number of TFT neural network parameters.
A change of TimeSeriesDataSet.max_prediction_length does not change the number of TFT neural network parameters.
To my understanding the architecture und number of blocks (Variable Selection, LSTM encoder, Gates) in the encoder is changing linearly with the number of time steps used as past input. Since this is per default (TFT.max_encoder_length = TimeSeriesDataSet.max_encoder_length) set with TimeSeriesDataSet.max_encoder_length, an increase/decrease of TimeSeriesDataSet.max_encoder_length (max_prediction_length) should result in a change of the number of network parameters. Since this is not the case for TFT and LSTM, I wonder if there is a bug in the implementation.
Is there a reason when setting TFT.max_encoder_length > TimeSeriesDataSet.max_encoder_length? Since something like context_length in NBeats or GluonTS DeepAR does not exist for TFT and is not meant to be, is it?
The TFT is a recurrent network, i.e. the number of parameters does not change with an increasing number of time steps. The parameter max_encoder_length is only used for interpretation purposes.
The number of network parameters for TFT and LSTM (maybe other models as well) does not change when changing either
max_encoder_length and/or max_prediction_length
in theTimeSeriesDataSet
class.For the calculation of the number of network parameters I used the implementation of PyTorch Forecasting and verified it with the standard pytorch implementation to calculate the number of network parameters.
For TFT (
min_encoder_length = max_encoder_length; min_prediction_length = max_prediction_length
):TFT.max_encoder_length = TimeSeriesDataSet.max_encoder_length
if not setdefault=10
.TFT.max_encoder_length
can be set to a higher value thanTimeSeriesDataSet.max_encoder_length
, but not smaller.TimeSeriesDataSet.max_encoder_length
orTFT.max_encoder_length
does not change the number of TFT neural network parameters.TimeSeriesDataSet.max_prediction_length
does not change the number of TFT neural network parameters.To my understanding the architecture und number of blocks (Variable Selection, LSTM encoder, Gates) in the encoder is changing linearly with the number of time steps used as past input. Since this is per default (TFT.max_encoder_length = TimeSeriesDataSet.max_encoder_length) set with TimeSeriesDataSet.max_encoder_length, an increase/decrease of TimeSeriesDataSet.max_encoder_length (max_prediction_length) should result in a change of the number of network parameters. Since this is not the case for TFT and LSTM, I wonder if there is a bug in the implementation.
Is there a reason when setting
TFT.max_encoder_length
>TimeSeriesDataSet.max_encoder_length
? Since something like context_length in NBeats or GluonTS DeepAR does not exist for TFT and is not meant to be, is it?@jdb78 Can you please comment on this issue?
Thanks a lot! David