Deep Learning

Formula cheatsheet

Every key formula from the course, one table per lecture. Click a heading to open the full lecture.

Perceptron & linear separabilitySearch on YouTube

TopicFormulaMeaning
MP sumf(x)=∑i=12wixif(x) = \sum_{i=1}^{2} w_i x_iFixed-weight sum before threshold
AND thresholda={1if ∑i=12wixi≥20if ∑i=12wixi<2a = \begin{cases} 1 & \text{if } \sum_{i=1}^{2} w_i x_i \ge 2 \\ 0 & \text{if } \sum_{i=1}^{2} w_i x_i \lt 2 \end{cases}AND fires only at sum two
Supervised mapy^=f(X)\hat{y} = f(X)Learned map predicts output
Single lossloss=Y−Y^\text{loss} = Y - \hat{Y}Single prediction error signal
Sigmoida=σ(z)=11+e−za = \sigma(z) = \frac{1}{1 + e^{-z}}Graded activity between zero one
Threshold forma={1if ∑i=1nwixi≥t0if ∑i=1nwixi<ta = \begin{cases} 1 & \text{if } \sum_{i=1}^{n} w_i x_i \ge t \\ 0 & \text{if } \sum_{i=1}^{n} w_i x_i \lt t \end{cases}Fire when sum reaches threshold
Bias netz=∑i=1nwixi+w0z = \sum_{i=1}^{n} w_i x_i + w_0Bias replaces threshold, fire at zero
Boundary forms∑i=1nwixi+w0=0⟺∑i=1nwixi−t=0⟺∑i=1nwixi=t\sum_{i=1}^{n} w_i x_i + w_0 = 0 \qquad\Longleftrightarrow\qquad \sum_{i=1}^{n} w_i x_i - t = 0 \qquad\Longleftrightarrow\qquad \sum_{i=1}^{n} w_i x_i = tSame boundary in three guises
Line formw1x1+w2x2+w0=0⟺y=mx+c    means    mx−y+c=0w_1 x_1 + w_2 x_2 + w_0 = 0 \qquad\Longleftrightarrow\qquad y = mx + c \;\; \text{means} \;\; mx - y + c = 0Two-input boundary is line
OR constraintsw0<0;  w0+w1≥0;  w0+w2≥0;  w0+w1+w2≥0w_0 \lt 0;\; w_0 + w_1 \ge 0;\; w_0 + w_2 \ge 0;\; w_0 + w_1 + w_2 \ge 0Four inequalities define OR
PLA updatew←w+xw \leftarrow w + x (miss); w←w−xw \leftarrow w - x (false alarm)Miss adds, false alarm subtracts
Separability∑wixi>−w0\sum w_i x_i \gt -w_0 for every point in PP; <−w0\lt -w_0 for every point in NNAll P positive, all N negative

ANN building blocks & activation functionsSearch on YouTube

TopicFormulaMeaning
Neuron sumz=∑i=1mwixi+ba=f(z)z = \sum_{i=1}^{m} w_i x_i + b \qquad a = f(z)Weighted sum plus activation level
Parameter stepθ←θ−η d Lossdθ\theta \leftarrow \theta - \eta\,\frac{d\,\text{Loss}}{d\theta}Step against gradient scaled by rate
Identity / step / signf(z)=zf(z) = z; 00 if z<0z \lt 0 else 11; −1/0/+1-1/0/+1 by sign of zzPiecewise activation trio
Sigmoid / tanhσ(z)=11+e−z\sigma(z) = \frac{1}{1 + e^{-z}}; tanh⁡(z)=ez−e−zez+e−z\tanh(z) = \frac{e^{z} - e^{-z}}{e^{z} + e^{-z}}Ranges (0,1) and (−1,1)
ReLU / SiLUf(z)=max⁡(0,z)f(z) = \max(0, z); f(z)=z σ(z)f(z) = z\,\sigma(z)Sparse rectifier and smooth version
Softmaxfi(zi)=exp⁡(zi)∑j=1kexp⁡(zj)∑i=1kfi=1f_i(z_i) = \frac{\exp(z_i)}{\sum_{j=1}^{k}\exp(z_j)} \qquad \sum_{i=1}^{k} f_i = 1Exponentiate normalize to probabilities
Slopesσ′(z)=σ(z) (1−σ(z))≤0.25\sigma'(z) = \sigma(z)\,(1 - \sigma(z)) \le 0.25; tanh⁡′(z)=1−tanh⁡2(z)\tanh'(z) = 1 - \tanh^{2}(z); ReLU slope 00 or 11Peak slopes govern vanishing flow
GeLUGeLU(z)≈0.5 z(1+tanh⁡(2/π (z+0.044715 z3)))\text{GeLU}(z) \approx 0.5\,z\left(1 + \tanh\left(\sqrt{2/\pi}\,\left(z + 0.044715\,z^{3}\right)\right)\right)Smooth NLP activation approximation

Feedforward networks & gradient descentSearch on YouTube

TopicFormulaMeaning
Hidden detectorhk=1 if akx1+bkx2>1, else 0h_k = 1 \text{ if } a_k x_1 + b_k x_2 \gt 1, \text{ else } 0One unit fires per pattern
Output ORy=1 if ∑i=14wihi>w0, else 0y = 1 \text{ if } \sum_{i=1}^{4} w_i h_i \gt w_0, \text{ else } 0OR over hidden winners
Sigmoid neuronf(z)=σ(z)=11+e−z,z=wx+bf(z) = \sigma(z) = \frac{1}{1 + e^{-z}}, \qquad z = wx + bNeuron output between zero one
Squared errorL=1n∑i=1n(y^i−yi)2,n=2L = \frac{1}{n}\sum_{i=1}^{n}(\hat{y}_i - y_i)^2, \qquad n = 2Average squared prediction error
Descent ruleθnew=θ−η ∇L(θ)\theta_{\text{new}} = \theta - \eta\,\nabla L(\theta)Step opposite gradient downhill
Taylor reasonL(θ+Δθ)≈L(θ)+∇L(θ)⋅ΔθL(\theta + \Delta\theta) \approx L(\theta) + \nabla L(\theta)\cdot\Delta\thetaPredict loss change from slope
Gradient shapef′(x)=dfdx,∇f(x,y)=[df/dxdf/dy]f'(x) = \frac{df}{dx}, \qquad \nabla f(x, y) = \begin{bmatrix} df/dx \\ df/dy \end{bmatrix}Slope scalar versus vector gradient
Sigmoid tweakΔw=(f(x)−y) f(x) (1−f(x)) x,Δb=(f(x)−y) f(x) (1−f(x))\Delta w = (f(x) - y)\,f(x)\,(1 - f(x))\,x, \qquad \Delta b = (f(x) - y)\,f(x)\,(1 - f(x))Per-sample tweak, average over points
Binary lossL=−[ylog⁡p+(1−y)log⁡(1−p)]L = -\big[y\log p + (1 - y)\log(1 - p)\big]Punish confident wrong binary bets
Multiclass lossL=−∑c=1Cyc log⁡pcL = -\sum_{c=1}^{C} y_c\,\log p_cOnly true class contributes
ApproximationOne hidden layer approximates any continuous ff to any ϵ\epsilonUniversal approximation guarantee
Curseneurons needed  ∝  kn\text{neurons needed} \;\propto\; k^nWidth explodes exponentially with dimension

Backpropagation & empirical riskSearch on YouTube

TopicFormulaMeaning
Forward passz=∑iwixi+ba=f(z)h=aO=F(z)z = \sum_i w_i x_i + b \qquad a = f(z) \qquad h = a \qquad O = F(z)Forward sums then activations
Sample lossL(y,O)=1n∑i=1n(yi−Oi)2L(y, O) = \frac{1}{n}\sum_{i=1}^{n}(y_i - O_i)^2Mean squared gap to label
Sigmoid slopeσ′(z)=σ(z)(1−σ(z))\sigma^{\prime}(z) = \sigma(z)(1 - \sigma(z))Slope needed for chain rule
Output signalδo=−2(y−O) O(1−O)w:=w−η ∂L∂w\delta_o = -2(y - O)\,O(1 - O) \qquad w := w - \eta\,\frac{\partial L}{\partial w}Output error times slope, descend
Hidden signalδh1=δo v1 h1(1−h1)δh2=δo v2 h2(1−h2)\delta_{h1} = \delta_o\,v_1\,h_1(1 - h_1) \qquad \delta_{h2} = \delta_o\,v_2\,h_2(1 - h_2)Backprop splits error by weights
Chain rule∂L∂w=∂L∂O ∂O∂z ∂z∂w∂z∂w=x\frac{\partial L}{\partial w} = \frac{\partial L}{\partial O}\,\frac{\partial O}{\partial z}\,\frac{\partial z}{\partial w} \qquad \frac{\partial z}{\partial w} = xMultiply local slopes for gradient
RiskR(θ)=1n∑i=1nL(yi,f(Xi,θ))R(\theta) = \frac{1}{n}\sum_{i=1}^{n}L(y_i, f(X_i, \theta))Average training loss to minimize

Regularization & deep networksSearch on YouTube

TopicFormulaMeaning
Penalized objectiveRreg(θ)=R(θ)+λ Ω(θ)R_{\text{reg}}(\theta) = R(\theta) + \lambda \, \Omega(\theta)Fit plus complexity penalty
Bias varianceBias(x)=E[f^(x)]−f(x)\text{Bias}(x) = E[\hat{f}(x)] - f(x), Var(x)=E[(f^(x)−E[f^(x)])2]\text{Var}(x) = E\left[(\hat{f}(x) - E[\hat{f}(x)])^2\right]Mean error versus spread
Sparse penaltiesΩL2(w)=∑iwi2=∥w∥22\Omega_{L2}(w) = \sum_i w_i^2 = \Vert w \Vert_2^2, ΩL1(w)=∑i∣wi∣=∥w∥1\Omega_{L1}(w) = \sum_i \vert w_i \vert = \Vert w \Vert_1Squares shrink, absolutes sparsify
Dropout testatest=p atraina_{\text{test}} = p \, a_{\text{train}}Scale test output by keep rate
Batch normμB=1m∑i=1mxi\mu_B = \frac{1}{m}\sum_{i=1}^{m} x_i, σB2=1m∑i=1m(xi−μB)2\sigma_B^2 = \frac{1}{m}\sum_{i=1}^{m}(x_i - \mu_B)^2, x^i=xi−μBσB2+ϵ\hat{x}_i = \frac{x_i - \mu_B}{\sqrt{\sigma_B^2 + \epsilon}}Standardize batch to zero mean
Ensemble meanfens(x)=1M∑m=1Mfm(x)f_{\text{ens}}(x) = \frac{1}{M}\sum_{m=1}^{M} f_m(x)Average models cancels faults
Rate stepwnew=w−η gw_{\text{new}} = w - \eta \, gLearning rate scales gradient step

Optimizers: momentum to AdamSearch on YouTube

TopicFormulaMeaning
Base descentθt+1=θt−η∇J(θt)\theta_{t+1} = \theta_t - \eta \nabla J(\theta_t)Slope-scaled downhill step
Momentumvt=βvt−1+∇J(θt)v_t = \beta v_{t-1} + \nabla J(\theta_t), θt+1=θt−ηvt\theta_{t+1} = \theta_t - \eta v_tAccumulate past gradients for speed
Lookaheadθ~t=θt−βvt−1\tilde{\theta}_t = \theta_t - \beta v_{t-1}, gt=∇J(θ~t)g_t = \nabla J(\tilde{\theta}_t), vt=βvt−1+ηgtv_t = \beta v_{t-1} + \eta g_t, θt+1=θt−vt\theta_{t+1} = \theta_t - v_tPeek ahead before leaping
Update countsBatch 11; SGD NN; minibatch N/BN/B updates per epochOne, N, N over B updates
AdagradGt=Gt−1+gt2G_t = G_{t-1} + g_t^2, θt+1=θt−ηGt+ϵgt\theta_{t+1} = \theta_t - \frac{\eta}{\sqrt{G_t + \epsilon}} g_tShrink rate for frequent gradients
RMSpropvt=βvt−1+(1−β)gt2v_t = \beta v_{t-1} + (1 - \beta) g_t^2, θt+1=θt−ηvt+ϵgt\theta_{t+1} = \theta_t - \frac{\eta}{\sqrt{v_t + \epsilon}} g_tMoving average keeps rates alive
Adam momentsmt=β1mt−1+(1−β1)gtm_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t, vt=β2vt−1+(1−β2)gt2v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2Mean and variance trackers
Adam correctionm^t=mt1−β1t\hat{m}_t = \frac{m_t}{1 - \beta_1^t}, v^t=vt1−β2t\hat{v}_t = \frac{v_t}{1 - \beta_2^t}, θt+1=θt−ηm^tv^t+ϵ\theta_{t+1} = \theta_t - \frac{\eta \hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}Debias early then adaptive step
Newtonθt+1=θt−H−1∇f(θt)\theta_{t+1} = \theta_t - H^{-1} \nabla f(\theta_t)Curvature-guided exact step

Convolution & CNN architectureSearch on YouTube

TopicFormulaMeaning
Additiony[i]=x[i]+h[i]y[i] = x[i] + h[i]Pairwise sum, same length
Full lengthy=x∗h,L=N+M−1y = x \ast h, \qquad L = N + M - 1Flip slide, longer output
NN sizeO=N−M+2PS+1O = \frac{N - M + 2P}{S} + 1Valid size from padding stride
1D slideSt=∑a=0k−1Xt+a WaS_t = \sum_{a=0}^{k-1} X_{t+a} \, W_aSlide dot product along vector
2D slideSi,j=∑m∑nIi+m,j+n Km,nS_{i,j} = \sum_{m} \sum_{n} I_{i+m, j+n} \, K_{m,n}Patch sum over rows columns
Image sizeWidth=C1−C2+2PS+1,Height=R1−R2+2PS+1\text{Width} = \frac{C_1 - C_2 + 2P}{S} + 1, \qquad \text{Height} = \frac{R_1 - R_2 + 2P}{S} + 1Apply size rule twice
RGB sumOi,j=∑c∑m∑nIi+m,j+n,c Km,n,c+bO_{i,j} = \sum_{c} \sum_{m} \sum_{n} I_{i+m, j+n, c} \, K_{m,n,c} + bSum channels plus bias
Sharing gainDense (9×4)+4=40,CNN 1×4=4\text{Dense } (9 \times 4) + 4 = 40, \qquad \text{CNN } 1 \times 4 = 4Sharing cuts forty to four
Poolingy=max⁡(x1,x2,x3,x4),y=x1+x2+x3+x44y = \max(x_1, x_2, x_3, x_4), \qquad y = \frac{x_1 + x_2 + x_3 + x_4}{4}Max keeps peak, average smooths

LeNet, AlexNet & embeddingsSearch on YouTube

TopicFormulaMeaning
Sigmoidσ(z)=11+e−z\sigma(z) = \frac{1}{1 + e^{-z}}Squashes unit sum to 0-1
Output sizeHout=Hin−F+2PS+1H_{out} = \frac{H_{in} - F + 2P}{S} + 1Tracks conv map height per layer
ReLUr(z)=max⁡(0,z)r(z) = \max(0, z)Keeps positives, zeroes negatives
Param countP=(Fh×Fw×Din+1)×KP = (F_h \times F_w \times D_{in} + 1) \times KCounts kernels plus biases
Euclidean distanced(a,b)=∑i=1n(ai−bi)2d(\mathbf{a}, \mathbf{b}) = \sqrt{\sum_{i=1}^{n}(a_i - b_i)^2}Ranks image similarity by distance

RNN & backprop through timeSearch on YouTube

TopicFormulaMeaning
RNN hiddenht=σ(Uxt+Wht−1+b)h_t = \sigma(U x_t + W h_{t-1} + b), y^t=Ot(Vht+c)\hat{y}_t = O_t(V h_t + c)Shared weights update state, predict output
Total lossL=∑t=1TLtL = \sum_{t=1}^{T} L_t; squared or cross-entropy per stepAdds step losses over sequence
BPTT sum∂L∂W=∑t=1T∂Lt∂W\frac{\partial L}{\partial W} = \sum_{t=1}^{T} \frac{\partial L_t}{\partial W}Sums shared gradients over time
Gradient chain∂ht∂ht−k=∏j=0k−1σ′(at−j) W\frac{\partial h_t}{\partial h_{t-k}} = \prod_{j=0}^{k-1} \sigma^\prime(a_{t-j})\,WLong product vanishes or explodes
Gradient clippingg←g⋅min⁡(1, τ/∥g∥)g \leftarrow g \cdot \min\left(1,\, \tau / \Vert g \Vert\right)Caps exploding gradients, keeps direction
Embedding lookupe=xone-hot E(1×V) (V×D)=(1×D)e = x_{\text{one-hot}}\,E \qquad (1 \times V)\,(V \times D) = (1 \times D)Copies embedding row, skips sparse multiply
Char predictionP(y=i∣z)=ezi/∑jezjLt=−log⁡P(y=label∣z)P(y = i \vert z) = e^{z_i}/\sum_j e^{z_j} \qquad L_t = -\log P(y = \text{label} \vert z)Softmax next char, negative log loss

LSTM, GRU & bidirectional RNNSearch on YouTube

TopicFormulaMeaning
Forget gateft=σ(Wfxt+Ufht−1+bf)f_t = \sigma(W_f x_t + U_f h_{t-1} + b_f)Erases stale cell memory selectively
Cell updateit=σ(Wixt+Uiht−1+bi)i_t = \sigma(W_i x_t + U_i h_{t-1} + b_i), C~t=tanh⁡(Wgxt+Ught−1+bg)\tilde{C}_t = \tanh(W_g x_t + U_g h_{t-1} + b_g), Ct=ft⊙Ct−1+it⊙C~tC_t = f_t \odot C_{t-1} + i_t \odot \tilde{C}_tAdds gated candidate to gated memory
Output gateot=σ(Woxt+Uoht−1+bo)o_t = \sigma(W_o x_t + U_o h_{t-1} + b_o), ht=ot⊙tanh⁡(Ct)h_t = o_t \odot \tanh(C_t)Filters cell into hidden output
GRU updatert=σ(Wrxt+Urht−1+br)r_t = \sigma(W_r x_t + U_r h_{t-1} + b_r), zt=σ(Wzxt+Uzht−1+bz)z_t = \sigma(W_z x_t + U_z h_{t-1} + b_z), h~t=tanh⁡(Wgxt+Ug(rt⊙ht−1)+bg)\tilde{h}_t = \tanh(W_g x_t + U_g (r_t \odot h_{t-1}) + b_g), ht=(1−zt)⊙ht−1+zt⊙h~th_t = (1 - z_t) \odot h_{t-1} + z_t \odot \tilde{h}_tMixes past and candidate by update
Bi-LSTM mergeyt=[h→t;h←t]y_t = [\overrightarrow{h}_t ; \overleftarrow{h}_t], yt=Wy[h→t;h←t]+byy_t = W_y [\overrightarrow{h}_t ; \overleftarrow{h}_t] + b_yConcats forward-backward contexts, projects
Bi-RNN mergesConcat [h→t;h←t][\overrightarrow{h}_t ; \overleftarrow{h}_t]; sum; average; element maxConcat doubles size, others keep size

Probability & Bayesian networksSearch on YouTube

TopicFormulaMeaning
Joint tableP(S,R)=P(S=s,R=r)P(S, R) = P(S = s, R = r) for each cellFull table holds all information
MarginalsP(S=s)=∑rP(S=s,R=r)P(R=r)=∑sP(S=s,R=r)P(S = s) = \sum_{r} P(S = s, R = r) \qquad P(R = r) = \sum_{s} P(S = s, R = r)Sums joint cells along rows or columns
ConditionalsP(S∣R)=P(S,R)P(R)P(R∣S)=P(S,R)P(S)P(S \vert R) = \frac{P(S, R)}{P(R)} \qquad P(R \vert S) = \frac{P(S, R)}{P(S)}Selects slice, normalizes to one
Chain ruleP(X,Y)=P(X) P(Y∣X)P(X,Y)=P(Y) P(X∣Y)P(X, Y) = P(X)\,P(Y \vert X) \qquad P(X, Y) = P(Y)\,P(X \vert Y)Rebuilds joint from marginal plus conditional
Independence testP(X∣Y)=P(X)orP(Y∣X)=P(Y)P(X \vert Y) = P(X) \quad \text{or} \quad P(Y \vert X) = P(Y)Knowing other changes nothing
Independent jointP(X,Y)=P(X) P(Y)P(X, Y) = P(X)\,P(Y)Joint equals product when independent
BN factorizationP(X1,X2,…,Xn)=∏i=1nP(Xi∣parents(Xi))P(X_1, X_2, \ldots, X_n) = \prod_{i=1}^{n} P(X_i \vert \text{parents}(X_i))Each node conditions on parents only
Loan profileP(a,¬b,c,¬d,e)=P(a) P(¬b∣a) P(c∣a,¬b) P(¬d∣c,e) P(e)P(a, \neg b, c, \neg d, e) = P(a)\,P(\neg b \vert a)\,P(c \vert a, \neg b)\,P(\neg d \vert c, e)\,P(e)Five-variable default factorization example
Bayes posteriorP(D∣F,C)=P(D,F,C)P(F,C)P(D \vert F, C) = \frac{P(D, F, C)}{P(F, C)}Posterior equals joint over symptom marginal
Disease jointP(D,F,C)=P(D) P(F∣D) P(C∣D)P(D, F, C) = P(D)\,P(F \vert D)\,P(C \vert D)Symptoms independent given disease
Word sequenceP(W1…W5)=P(W1) P(W2∣W1) P(W3∣W1,W2) P(W4∣W2,W3) P(W5∣W3,W4)P(W_1 \ldots W_5) = P(W_1)\,P(W_2 \vert W_1)\,P(W_3 \vert W_1, W_2)\,P(W_4 \vert W_2, W_3)\,P(W_5 \vert W_3, W_4)Two-parent chain models review probability

Markov chains & Gibbs samplingSearch on YouTube

TopicFormulaMeaning
Markov propertyP(Xt+1=j∣Xt=i,…)=P(Xt+1=j∣Xt=i)P(X_{t+1} = j \vert X_t = i, \ldots) = P(X_{t+1} = j \vert X_t = i)Future depends only on present
Transition matrixTij=P(Xt+1=j∣Xt=i),∑jTij=1T_{ij} = P(X_{t+1} = j \vert X_t = i), \qquad \sum_j T_{ij} = 1Rows sum to one, same each step
State countNstates=2nN_{\text{states}} = 2^nBinary seats give power-of-two states
Distribution updateμt+1=μtT\mu_{t+1} = \mu_t TRow vector times matrix evolves distribution
Stationary distributionμ∗=μ∗T\mu^* = \mu^* TLong-run distribution reproduces itself
Cover boundf(x)≤c⋅g(x)for all xf(x) \le c \cdot g(x) \quad \text{for all } xProposal scaled covers target everywhere
Accept chanceP(accept∣x)=f(x)c⋅g(x)P(\text{accept} \vert x) = \frac{f(x)}{c \cdot g(x)}Keep candidate with ratio chance
MCMC chainX0→X1→X2→⋯→Xm→⋯X_0 \to X_1 \to X_2 \to \cdots \to X_m \to \cdotsDependent draws converge to target
Gibbs XP(x∣y)=P(x,y)P(y)P(x \vert y) = \frac{P(x, y)}{P(y)}Sample X fixing Y, no normalizer
Gibbs YP(y∣x)=P(x,y)P(x)P(y \vert x) = \frac{P(x, y)}{P(x)}Sample Y fixing X, alternate steps

RBM & generative modelsSearch on YouTube

TopicFormulaMeaning
Hidden activationaj=cj+∑ivi Wij,pj=σ(aj)a_j = c_j + \sum_i v_i\,W_{ij}, \qquad p_j = \sigma(a_j)Weighted sum to firing probability
Reconstruction errorerror=1n∑i=1n(vi−ri)2\text{error} = \frac{1}{n}\sum_{i=1}^{n}(v_i - r_i)^2Mean squared gap to minimum
EnergyE(v,h)=−∑ibivi−∑jcjhj−∑i∑jvi Wij hjE(v,h) = -\sum_i b_i v_i - \sum_j c_j h_j - \sum_i\sum_j v_i\,W_{ij}\,h_jLow energy means high probability
Joint distributionP(v,h)=exp⁡(−E(v,h))Z,Z=∑v∑hexp⁡(−E(v,h))P(v,h) = \frac{\exp(-E(v,h))}{Z}, \qquad Z = \sum_v\sum_h \exp(-E(v,h))Boltzmann distribution over all states
ConditionalsP(hj=1∣v)=σ(cj+∑iWij vi),P(vi=1∣h)=σ(bi+∑jWij hj)P(h_j = 1 \vert v) = \sigma\left(c_j + \sum_i W_{ij}\,v_i\right), \qquad P(v_i = 1 \vert h) = \sigma\left(b_i + \sum_j W_{ij}\,h_j\right)Same weights both directions via sigmoid
Sigmoidσ(x)=11+exp⁡(−x)\sigma(x) = \frac{1}{1 + \exp(-x)}Maps total input to probability
CD updateΔWij=η (⟨vihj⟩data−⟨vihj⟩model)\Delta W_{ij} = \eta\,\left(\langle v_i h_j\rangle_{\text{data}} - \langle v_i h_j\rangle_{\text{model}}\right)Data association minus model association

Autoencoders, VAE & GANSearch on YouTube

TopicFormulaMeaning
Autoencoder maph=f(x)=σ(Wx+b),x′=g(h)=σ(W′h+c)h = f(\mathbf{x}) = \sigma(W\mathbf{x} + b), \qquad \mathbf{x}' = g(h) = \sigma(W'h + c)Encode to bottleneck, decode back
MSE lossLMSE=1n∑i=1n(xi−xi′)2L_{\text{MSE}} = \frac{1}{n}\sum_{i=1}^{n}(x_i - x'_i)^2Averages squared gaps for continuous values
BCE lossLBCE=−1n∑i=1n[yilog⁡yi′+(1−yi)log⁡(1−yi′)]L_{\text{BCE}} = -\frac{1}{n}\sum_{i=1}^{n}\left[y_i\log y'_i + (1 - y_i)\log(1 - y'_i)\right]Averages log loss for binary outputs
Latent priorq(z∣x)=N(μ,σ2),p(z)=N(0,1)q(z \vert \mathbf{x}) = \mathcal{N}(\mu, \sigma^2), \qquad p(z) = \mathcal{N}(0, 1)Learned Gaussian versus standard normal
VAE lossL=Lrecon+LKLL = L_{\text{recon}} + L_{\text{KL}}Reconstruction plus regularization toward prior
KL termLKL=−12(1+log⁡σ2−μ2−σ2)L_{\text{KL}} = -\frac{1}{2}\left(1 + \log\sigma^2 - \mu^2 - \sigma^2\right)Penalizes deviation from standard normal
Reparameterizationz=μ+σ ε,ε∼N(0,1)z = \mu + \sigma\,\varepsilon, \qquad \varepsilon \sim \mathcal{N}(0, 1)Outside noise lets gradients flow through
Bayes linkP(Y∣X)=P(X,Y)P(X)P(Y \vert X) = \frac{P(X, Y)}{P(X)}Links joint, conditional, data distributions
GAN valuemin⁡Gmax⁡DV(G,D)=Ex[log⁡D(x)]+Ez[log⁡(1−D(G(z)))]\min_G \max_D V(G, D) = \mathbb{E}_{\mathbf{x}}[\log D(\mathbf{x})] + \mathbb{E}_z[\log(1 - D(G(z)))]Discriminator maximizes, generator minimizes value
BCE singleL=−[ylog⁡y′+(1−y)log⁡(1−y′)]L = -\left[y\log y' + (1 - y)\log(1 - y')\right]Single label log loss form
ConvergencePg(X)≈Pdata(X)P_g(X) \approx P_{\text{data}}(X)Fake distribution matches real distribution