sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.98k stars 631 forks source link

Question: LSTM layer cannot set to 0 #450

Closed ss20212 closed 3 years ago

ss20212 commented 3 years ago

I am a beginner deep learning learner. Currently, I am learning with the tutorial of "Demand forecasting with the Temporal Fusion Transformer. Can LSTM layer set to 0?

I got this error when I set it to 0. Thanks.

IndexError Traceback (most recent call last)

in () 27 loss=QuantileLoss(), 28 log_interval=10, # uncomment for learning rate finder and otherwise, e.g. to 10 for logging every 10 batches ---> 29 reduce_on_plateau_patience=4, 30 ) 31 print(f"Number of parameters in network: {tft.size()/1e3:.1f}k") 6 frames /usr/local/lib/python3.7/dist-packages/torch/nn/modules/rnn.py in flatten_parameters(self) 144 # or the tensors in _flat_weights are of different dtypes 145 --> 146 first_fw = self._flat_weights[0] 147 dtype = first_fw.dtype 148 for fw in self._flat_weights: IndexError: list index out of range
jdb78 commented 3 years ago

No, you cannot remove the LSTM layer from the architecture completely.

ss20212 commented 3 years ago

Thank you!