Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Time Series with PyTorch
  • Table Of Contents Toc
Time Series with PyTorch

Time Series with PyTorch

By : Graeme Davidson, Lei Ma
close
close
Time Series with PyTorch

Time Series with PyTorch

By: Graeme Davidson, Lei Ma

Overview of this book

Neural networks are powerful tools for time-series forecasting, but applying them effectively requires both practical experience and a clear understanding of architectures, training strategies, and evaluation methods. This book brings these ideas together in a structured and practical way. Starting with PyTorch fundamentals, you will build neural networks from scratch and progress through recurrent networks, attention mechanisms, and transformers before exploring forecasting architectures such as N-BEATS, N-HiTS, and the Temporal Fusion Transformer. Along the way, you will learn robust hyperparameter tuning, conformal prediction for uncertainty estimation, and reliable evaluation practices. Unlike most forecasting books, this text also explores topics often overlooked or treated separately, including transfer learning across collections of series, synthetic data generation with diffusion models, and self-supervised representation learning. Beyond forecasting, later chapters cover classification, clustering, anomaly detection, and embeddings for large-scale time-series modeling. Throughout, the focus is pragmatic: theory is reinforced through experimentation and implementation so you can apply these methods confidently to real-world time-series problems.
Table of Contents (22 chapters)
close
close
20
Other Books You May Enjoy
21
Index

Preface

Temporally embedded data is fundamental to our world; it tells us about what has been, why it has been and what it may become. You see it everywhere, from the melodies of your favorite musician/composer and the neural activity in your brain to the energy powering your computer and the critical supply chain supplying your food. Often, people only see them when something bad is happening, e.g., a financial crash, average global temperature increases, COVID-19 cases, and hospital beds. On the opposite side of dualism, we see life expectancy increasing, poverty decreasing, literacy increasing, and an abundance of food supply. More information is available to us than ever before to explain our lives and environments, and with that data, we can understand and improve the world around us.

Modeling this data is a fascinating and challenging area of data science and statistics, and I think it is fair to say that many people find it so. Temporal dependencies, non-stationarity, missing observations, modeling residual data, and a variety of data-generating processes all conspire to make forecasting difficult for novices. This is not helped by the fact that books like Hamilton’s Time Series Analysis (which is excellent) are impenetrable without developing a strong mathematical and statistical knowledge. However, not everyone needs to be at the level of a quantitative analyst for Renaissance Technologies. Many people, such as Rob Hyndman, have worked hard to develop and improve knowledge around time series forecasting.

Neural networks and Deep learning (depending on how you define it) entered the scene around the late 1980s, when Feed-Forward Networks (FFNs) started to be used for sequential modeling, followed by LSTMs in 1997. And there they sat, useful but not making much headway in forecasting until 2017, when Transformers were created by a team at Google, followed by Oreshkin et al.’s N-BEATS, N-HiTS and a huge range of new architectures and techniques for training that allow us to apply cross-learning and transfer-learning on untrained and trained models.

Currently, many of these networks/algorithms can be, or are, written in PyTorch, which gives us a flexible and expressive framework for building, training, and evaluating forecasting models, from simple FFNs to foundation models trained across thousands of series. Of course, the kind people at NeuralForecast and Darts have done a lot of the work for us, so you only need to start from scratch occasionally.

It has never been easier to experiment with neural networks, but how do these architectures work, how do we decide between them, and when are they useful? In time series forecasting there is no free lunch; this book aims to help you understand that, and to guide your intuition by explaining how these architectures build functions for temporal data, so that you can be confident in your choices.

This book is a practical guide. We wrote it for data scientists, machine learning engineers, and researchers who already have some experience with Python and statistics but want to build a working understanding of modern deep learning approaches to time series. Our goal is not to catalog every published architecture, but to give you the conceptual foundations, hands-on code, and evaluation discipline you need to design, build, and critically assess forecasting systems in practice.

The book is organized in three broad sections. The first third (Chapters 1 to 7) establishes foundations: what makes time series data challenging, how to evaluate models honestly, the mechanics of PyTorch, and how to build, optimize, and calibrate neural networks with conformal prediction intervals. The middle section (Chapters 8 to 13) covers major architectural families — recurrent networks, transformers, Convolutional Neural Networks (CNNs), graph neural networks, and generative models, including Variational Autoencoders (VAEs) and diffusion — alongside transfer learning and global modeling strategies. The final third (Chapters 14 to 18) moves beyond point forecasting into classification, clustering, embeddings, anomaly detection, and self-supervised learning, reflecting the breadth of tasks practitioners often encounter.

Throughout, we emphasize understanding over black-box application. We want you to know why an architecture works the way it does, not just how to call its API. Where possible, we build models from first principles in PyTorch before showing how libraries like Nixtla’s NeuralForecast and statsforecast can accelerate your experimentation. We hope you find it useful.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Time Series with PyTorch
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon