How do we find the best path in a maze of choices?
Image: Unidentified U.S. Army photographer, Public domain, via Wikimedia Commons
How do we find the best path in a maze of choices?
Imagine you're playing a game where you have to guess a sequence of colors to win a prize. Each guess costs money, and you want to minimize your losses while maximizing your chances of winning.
Think of each color as a step in a path. Viterbi looks at the most likely sequence of colors, while dynamic programming checks every possible sequence. Viterbi is like choosing the most obvious path, while dynamic programming explores every option.
Example
You have three colors to choose from: red, blue, and green. Viterbi might choose red, then blue, then green, because it seems most likely. Dynamic programming would check every combination: red-red-red, red-red-blue, red-blue-red, and so on.
Remember this
Viterbi quickly finds a good path by looking at the most likely choices, while dynamic programming checks every possibility to find the best one.
Text adapted from Wikipedia, licensed under CC BY-SA 4.0.
Overlapping subproblems
Ever calculated a huge Fibonacci sequence by hand?
Greedy vs dynamic programming: greedy makes locally optimal choices, DP considers all subproblems
Greedy: locally optimal choices; DP: considers all subproblems
Proximal gradient methods for learning
Why can't we always find the best path in a maze?
branch prediction does: guesses which way an if-statement will go to keep the pipeline full
How can a computer make decisions faster?
Triton differs from CUDA
Why does a super-fast computer sometimes run slower than a regular one?
BFS vs DFS: BFS finds shortest path in unweighted graphs, DFS uses less memory
BFS finds shortest path in unweighted graphs; DFS uses less memory
Swipe through 100 ML concepts daily
Open Pocket Polymath