S14 · Problem set 9
Problem set 9: probabilistic PCA and whitening, filtering and likelihoods in hidden Markov models, mixing of chains and samplers, importance weights, tree splits and boosting rounds, forests, values and updates in reinforcement learning, and serving and quantizing models
These problems cover lessons 40 to 47: principal components as a probabilistic model, hidden Markov models followed through several observations, how fast Markov chains and samplers forget their starting point, ensembles of trees, values and updates for a learning agent, and the memory, bandwidth and precision that decide what a model costs to run.
Check
A four-dimensional data set's covariance has eigenvalues 6, 3, 1.2 and 0.6. Probabilistic PCA keeps two components.
(a)
What noise variance does it estimate?
(b)
What fraction of the variance do the two components explain?
Check
Data have covariance with a = 4, b = 1, c = −1.5. A point lies at (−1, 1) from the mean.
(a)
How far is it after whitening (its Mahalanobis distance)?
Check
A machine is faulty with probability 0.02 at hour 1. A healthy machine stays healthy with probability 0.95; a faulty one is repaired with probability 0.6 per hour. Its alarm fires with probability 0.1 when healthy and 0.6 when faulty, and it fires in hours 1 and 2.
(a)
What is P(faulty at hour 1 | the first alarm)?
(b)
What is P(faulty at hour 2 | both alarms)?
Check
The same kind of machine: faulty with probability 0.05 at hour 1, staying healthy with probability 0.9, repaired with probability 0.5, alarms 0.2 healthy and 0.7 faulty.
(a)
What is the probability of an alarm in hour 1?
(b)
What is the probability of alarms in both hours 1 and 2?
Check
A two-state chain leaves state 1 with probability 0.05 and state 2 with probability 0.1.
(a)
By what factor does its distance from equilibrium shrink each step?
(b)
How many steps bring that distance down by a factor of 0.001?
Check
A random-walk Metropolis sampler targets a Gaussian of standard deviation 1 with proposal steps of standard deviation 1.
(a)
What fraction of proposals does it accept?
(b)
What step size would give an acceptance rate of 0.6?
Check
A Gibbs sampler alternates between two standard Gaussian variables with correlation 0.9.
(a)
What fraction of its sweeps count as independent samples?
(b)
How many sweeps give 500 effective samples?
Check
Importance sampling estimates expectations under N(0, 1) with samples from N(0, 2²).
(a)
What fraction of the samples is effective (1 over the mean squared weight)?
(b)
How many samples give an effective 1000?
Check
A split sends 30 positive and 10 negative examples left and 20 positive and 35 negative right.
(a)
What is the parent node's entropy?
(b)
What is the split's information gain?
Check
An AdaBoost round's stump has weighted error 0.2. One example it misclassified had weight 0.01.
(a)
What is the stump's vote α?
(b)
What is that example's weight after reweighting and normalizing?
Check
Bagged trees each have prediction variance 1 and pairwise correlation 0.6. Sampling features at each split cuts the correlation to 0.15 but raises each tree's variance by a factor of 1.5.
(a)
What variance does averaging 50 bagged trees give?
(b)
And 50 trees with feature sampling?
Check
A sensor policy earns 1 per step while charged and 0 while low, goes low with probability 0.4 and recharges with probability 0.6; γ = 0.9.
(a)
What is the charged state worth?
(b)
What is its long-run average reward per step?
Check
An agent with discount 0.8 has Q(s, a) = 1, receives r = 1 and lands where the best action value is 4; its learning rate is 0.2.
(a)
What does Q(s, a) become?
(b)
How many value-iteration sweeps would shrink an error by a factor of 0.001 at this discount?
Check
An 8-billion-parameter model with 4-bit weights runs on a chip with 1000 TFLOP/s and 3.35 TB/s, at batch 8.
(a)
At what batch does it become compute-bound?
(b)
What throughput does it reach at batch 8?
Check
A 7-billion-parameter model's weights are quantized symmetrically. Reading a byte from DRAM costs 640 pJ.
(a)
How much memory does going from 8-bit to 4-bit weights save?
(b)
How much signal-to-quantization-noise ratio does a full-scale uniform signal lose (127 levels against 7 on each side)?
(c)
How much energy does reading the 4-bit weights once take?
Write units the way you normally would: 1.5 J, 1500 mJ and 0.0015 kJ are the same answer.
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.