Transformers for Epidemic Forecasting

A 10-week self-study course bridging epidemiological modeling and modern transformer architectures.

View the Project on GitHub aflaxman/learning-about-transformers-for-epidemic-forecasting

A 10-Week Effort to Learn About Transformers for Epidemic Forecasting

đź“– View this course online

Course Overview

A streamlined self-study course bridging epidemiological modeling and modern transformer architectures for time series forecasting.

Meeting Time: Wednesdays 1:05-2:00 PM
Duration: July 2 - September 3, 2025

Course Schedule

Weekly Meeting Format

Before the First Meeting

Please complete by July 2:

  1. Set up Python environment (see Tools & Setup section)
  2. Create a GitHub repository for your course work
  3. Download at least one dataset from Project Tycho
  4. Read Week 1’s paper
  5. Optional: Watch But what is a GPT? by 3Blue1Brown for intuition on decoder-only models

Week 1: Epidemiological Foundations

Wednesday, July 2, 2025 | 1:00 PM

Core Reading

Mini-Project

Simple SEIR Simulator

Resources


Week 2: Time Series Fundamentals

Wednesday, July 9, 2025 | 1:00 PM

Core Reading

Mini-Project

Flu Forecasting with ARIMA

Resources


Week 3: Understanding Transformers

Wednesday, July 16, 2025 | 1:00 PM

Core Reading

Mini-Project

Attention Visualization


Week 4: Decoder-Only Transformers

Wednesday, July 23, 2025 | 1:00 PM

Core Reading

Mini-Project

Autoregressive Generation for Time Series

Code Hint

# Causal masking example
import numpy as np
# Create a mask where future values are hidden
seq_len = 5
causal_mask = np.tril(np.ones((seq_len, seq_len)))
print(causal_mask)  # Lower triangular matrix

Week 5: Transformers Meet Time Series

Wednesday, July 30, 2025 | 1:00 PM

Core Reading

Mini-Project

First Transformer Forecast

Code Start

from transformers import TimeSeriesTransformerForPrediction

Week 6: Chronos Foundation Model

Wednesday, August 6, 2025 | 1:00 PM

Core Reading

Mini-Project

Zero-Shot Disease Forecasting

Quick Start

from chronos import ChronosPipeline
pipeline = ChronosPipeline.from_pretrained("amazon/chronos-t5-tiny")

Week 7: Beyond Numbers - Text and Time Series

Wednesday, August 13, 2025 | 1:00 PM

Core Reading

Mini-Project

Text-Enhanced Forecasting with Decoder-Only Models


Week 8: Spatial Patterns

Wednesday, August 20, 2025 | 1:00 PM

Core Reading

Mini-Project

Multi-Region Forecasting


Week 9: Synthetic Data Strategies

Wednesday, August 27, 2025 | 1:00 PM

Core Reading

Mini-Project

Generate Synthetic Outbreaks


Week 10: Fine-tuning Foundation Models

Wednesday, September 3, 2025 | 1:00 PM

Core Reading

Mini-Project

Disease-Specific Fine-Tuning


Tools & Setup

Essential Libraries

pip install pandas numpy matplotlib
pip install statsmodels
pip install transformers
pip install chronos-forecasting
pip install torch  # or tensorflow

Compute Resources


Weekly Time Commitment

Success Tips

  1. Focus on understanding concepts over implementation details
  2. Start simple - you can always add complexity
  3. Document your learning journey
  4. Share your work (slack, GitHub, blog posts)
  5. Join communities (Hugging Face Forums)
  6. Pay special attention to Week 4 - decoder-only architectures are crucial for modern LLMs

By course end, you’ll have: