-
Book Overview & Buying
-
Table Of Contents
Time Series with PyTorch
By :
In this chapter, we explored how recurrent neural networks (RNNs) can model sequential dependencies in time series forecasting. We began with simple RNNs, noting their limitations in capturing long-term patterns due to vanishing and exploding gradients. We then introduced LSTM and GRU architectures, which use gating mechanisms to preserve relevant information. Stacked RNNs were discussed as a way to increase model capacity. As a practical example, we implemented an RNN forecaster in PyTorch on a sinusoidal dataset, comparing it with a naive baseline. The RNN outperformed the baseline, highlighting its strengths, though real-world use requires backtesting, tuning, and often packaged implementations.