Derivation Memory Skeletons
These are short memory cues, not full answers.
Logistic Regression
z = Xw + bp = sigmoid(z)- BCE loss
dL/dz = p - ygrad_w = X^T (p - y) / n
Softmax + CE
- write softmax
- write CE
- use one-hot target
- result:
p - y
Bernoulli MLE
- write Bernoulli likelihood
- take log
- differentiate w.r.t.
p - solve -> sample mean
Gaussian MLE
- write Gaussian log-likelihood
- derive w.r.t.
mu - derive w.r.t.
sigma^2 - note MLE uses
/ n
Confidence Interval
- estimate
- standard error
- critical value
- center +/- margin
Attention Shapes
Q (n, d_k)K (n, d_k)QK^T -> (n, n)- multiply by
V (n, d_v)->(n, d_v)
Saying it out loud (how to use this page). These aren’t answers, they’re the order of your hand movements — the point is that under pressure you forget structure long before you forget algebra. So practise them the way you’d practise a route: say the step, then write it, then say the next one, out loud, standing up, without looking. If you can recite the five steps of the logistic regression skeleton cold, you can rebuild the whole derivation live even if the sigmoid derivative escapes you for a second, because the skeleton tells you what to reach for next. Two rules that make this work: never write silently, and always say what you’re about to do before you do it, so a pause reads as thinking rather than being stuck. The failure mode this prevents is the worst one at a whiteboard — freezing mid-derivation with a marker up and no idea what line comes next.