Skip to content

CS188 Decisions and Machine Learning: From VPI and Naive Bayes to Attention

Aug 22, 2026 1 min
TL;DR Lectures 19–25 connect rational decisions and VPI to machine learning, while Project 5 uses PyTorch for regression, classification, CNNs, attention, and an optional character-GPT.
Table of Contents
  1. This is not a replacement for a full deep-learning course
  2. Make the small model explainable first
  3. References

🌏 中文版

Lectures 19–25 move from rational decisions and value of perfect information to decision trees, linear regression, Naive Bayes, neural networks, language models, and fine-tuning. Project 5 implements the second half in PyTorch through nonlinear regression, digit and language classification, CNNs, attention, and an optional character-GPT.

This is not a replacement for a full deep-learning course

P5 introduces the modern ML workflow inside a broad AI course: model definition, forward pass, loss, optimizer, batches, and training loop. Its breadth does not replace a dedicated course in optimization, representation learning, or large models. Treat each task as an interface exercise instead of trying to acquire all underlying theory at once.

Make the small model explainable first

In regression, explain input and output shapes, falling loss, and held-out behavior before advancing. Digit classification adds multiclass loss; language identification adds sequences; the CNN task introduces spatial inductive bias; and attention requires tracking query, key, and value tensor relationships.

The official P5 specification warns that NumPy 2.0 can cause compatibility failures and suggests 1.24.3 or another version below 2.0 when those errors appear. Treat this as environment reproduction, not a reason to hide the mismatch with a model-code workaround.

For every task, record a baseline, loss curve, and one failure case. The local autograder can test interfaces and thresholds, but it cannot explain why a model fails. That example is the analysis independent study must add.

Series navigation: Previous: Bayes nets and Ghostbusters | Next: Completion route

References