Skip to content
All tags

#harvard-cs50ai

10 posts

Cross-Week Review (1): How the Ideas of Seven Weeks Connect and Replace One Another | Harvard CS50 AI Topic Guide

Three kinds of relationship you see when the seven weeks are put side by side: an idea that returns in later weeks (the Markov chain from Week 2 is used again in Weeks 4 and 6; the linear combination of weights from Week 4 becomes Week 5's unit); an earlier week's tool that a later week depends on; and the lectures teaching one method, saying where it falls short, and moving to the next. Includes three cross-week examples and four cross-week self-check questions.

Cross-Week Review (2): Which Lecture Material Each of the Twelve Projects Uses | Harvard CS50 AI Topic Guide

The twelve projects side by side: which functions each has you write, which lecture section it uses, and what example the spec page gives you to check against; which projects share a method (enumeration, search, Markov chains, learning from data) and which need something the lectures do not teach. Includes three worked examples and five self-check questions. The course gives no difficulty ratings or hour estimates, and neither does this post.

Knowledge — Propositional Logic, Model Checking, Inference Rules & Knowledge Representation | Harvard CS50 AI Week 1

Week 1 is about getting a program to derive new facts from known ones: propositional symbols and five connectives turn knowledge into sentences; model checking enumerates all 2^n truth assignments to decide whether the knowledge base entails a query; inference rules and resolution work on the sentences directly, converting to CNF and deriving the empty clause by contradiction; first-order logic cuts the number of symbols with constants, predicates and quantifiers. With time links for every section, plus the approach, common mistakes and self-checks for the Knights and Minesweeper projects (reference implementations folded away).

Uncertainty — Probability, Bayesian Networks, Markov Models & Genetic Inference | Harvard CS50 AI Week 2

Week 2 is about probability: conditional probability and Bayes' rule turn evidence into probabilities; a Bayesian network uses arrows to split a joint probability into one conditional probability table per node, inference by enumeration is exact but slow, and rejection sampling and likelihood weighting approximate it with samples; a Markov chain describes a state that changes over time with a transition model, and a hidden Markov model adds a sensor model to work back from observations to states you cannot see. With time links for every section, plus the approach and checks for the Heredity and PageRank projects.

Optimization — Local Search, Simulated Annealing, CSP & Crossword Generation | Harvard CS50 AI Week 3

Week 3 covers three ways to write an optimization problem. Local search keeps a single state: hill climbing moves to a better neighbor and gets stuck at local optima, and simulated annealing accepts a worse move with probability e^(ΔE/T). Linear programming writes the problem as a linear cost function plus linear constraints and hands it to an existing solver. Constraint satisfaction problems shrink domains with node consistency and arc consistency (AC-3), then find a solution with backtracking search guided by the MRV, degree and least-constraining-value heuristics. Includes per-section time links, plus the approach, pseudocode, pitfalls and checks for the Crossword project (the reference implementation is folded at the end).

Learning — Supervised Learning, k-NN, SVM, Reinforcement Learning Q-learning & Nim | Harvard CS50 AI Week 4

Week 4 covers three forms of machine learning. Supervised learning fits a hypothesis function to labeled data: classify by the k nearest neighbors, or draw a decision boundary with a set of weights (perceptron learning rule, logistic regression, support vector machines), then use loss functions, regularization and cross-validation against overfitting. Reinforcement learning uses Q-learning to update the estimated value of each state and action from rewards, with ε-greedy keeping some probability of random exploration. Unsupervised learning clusters with k-means. With time links for every section, plus the approach and ways to check your work for the Shopping and Nim projects.

Neural Networks — Backpropagation, TensorFlow/Keras, CNN & Traffic Sign Classification | Harvard CS50 AI Week 5

Week 5 is about neural networks: a unit multiplies its inputs by weights, adds a bias and applies an activation function; gradient descent adjusts the weights one small step at a time, and backpropagation passes the error back so hidden layers can be trained; for images, convolution and pooling come first and an ordinary network follows, which is a CNN; for sequences, an RNN feeds its output back into itself. With time links for every section, plus the approach, common mistakes and checks for the Traffic project.

Language — N-grams, Parser, Attention & the Transformer | Harvard CS50 AI Week 6

Week 6 is about getting computers to handle natural language: parse sentences with hand-written context-free grammar rules, then switch to statistics, from n-grams and Markov-chain text generation to a Naive Bayes classifier for review sentiment; turn words into vectors with word2vec, process whole sequences with an RNN encoder–decoder, and finish with attention and the Transformer. Includes section-by-section time links, plus an approach, common mistakes and ways to check your work for the Parser and Attention projects.

Course Retrospective and Next Steps: What Seven Weeks Taught, What They Left Out, What to Read Next | Harvard CS50 AI Topic Guide

The last post in the series: one table reviewing what each of the seven weeks taught and which projects it had; in 2023 the course replaced Week 6 with a new version that reaches attention and the Transformer, while the other six weeks remain 2020 recordings; the lectures do not teach how to use today's language models. The second half links to this site's overviews of nine follow-up courses, by where you want to go. Includes three review self-check questions.

Search — From DFS, BFS, A* to Minimax and Alpha-Beta Pruning | Harvard CS50 AI Week 0

Week 0 is about search: DFS and BFS differ only in whether the frontier is a stack or a queue; A* adds the steps already taken to a heuristic estimate and guarantees the shortest path when the heuristic never overestimates; Minimax has the two players take the maximum and the minimum in turn, and alpha-beta pruning cuts branches that cannot change the result. With time links for every section, plus the approach, common mistakes and ways to check your work for the Degrees and Tic-Tac-Toe projects; the reference implementations are folded at the end of each project.