Every formula in the course on one page. Symbols first, then the formulas, grouped by chapter.
Symbols
Averages and bandits
Expected value of a quantity that takes value xi with probability pi:
E[X]=i∑pixi.
Running average, after a new observation x (this is the pattern behind nearly every update in the course):
new estimate=old estimate+α(x−old estimate).
Returns and MDPs
Gt=Rt+1+γRt+2+γ2Rt+3+⋯
Bellman equations
Vπ(s)=a∑π(a∣s)s′∑P(s′∣s,a)[r+γVπ(s′)]
V∗(s)=amaxs′∑P(s′∣s,a)[r+γV∗(s′)]
Learning from experience
Monte Carlo: move the estimate toward the return of the whole episode.
V(s)←V(s)+α(G−V(s))
TD(0): move it toward the reward plus the estimate of the next state.
V(s)←V(s)+α(r+γV(s′)−V(s))
SARSA (on-policy):
Q(s,a)←Q(s,a)+α(r+γQ(s′,a′)−Q(s,a))
Q-learning (off-policy):
Q(s,a)←Q(s,a)+α(r+γa′maxQ(s′,a′)−Q(s,a))
Gradient descent and networks
Step against the slope of the error E with respect to a weight w:
w←w−αdwdE.
A neuron: a weighted sum, then a bend (an activation function such as the ReLU, which is max(0,z)):
output=f(w1x1+w2x2+⋯+b).
DQN
Target and loss:
target=r+γa′maxQtarget net(s′,a′),loss=(Q(s,a)−target)2.
Policy gradients
Softmax:
π(a)=∑jeθjeθa.
For a softmax, the slope of lnπ(a) with respect to the scores is "one-hot minus probabilities". The update after taking action a with advantage A:
θ←θ+αA∇lnπ(a).
Elo
EA=1+10(RB−RA)/4001,RA←RA+K(SA−EA).