Gradient Descent with Momentum
v_t = \beta v_{t-1} + \nabla L(\theta_t), \quad \theta_{t+1} = \theta_t - \eta v_t
eta: learning rate, beta: momentum coefficient (typically 0.9).
Gradient descent with momentum updates, confusion-matrix metrics (precision, recall, F1, MCC), and neural network activation functions with exact derivatives.
v_t = \beta v_{t-1} + \nabla L(\theta_t), \quad \theta_{t+1} = \theta_t - \eta v_t
eta: learning rate, beta: momentum coefficient (typically 0.9).
P = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FP}}, \quad R = \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FN}}, \quad F_1 = \frac{2 P R}{P + R}
F1 is the harmonic mean of precision and recall, penalizing extreme imbalance.
\mathrm{MCC} = \frac{\mathrm{TP}\cdot\mathrm{TN} - \mathrm{FP}\cdot\mathrm{FN}}{\sqrt{(\mathrm{TP}+\mathrm{FP})(\mathrm{TP}+\mathrm{FN})(\mathrm{TN}+\mathrm{FP})(\mathrm{TN}+\mathrm{FN})}}
Balanced [-1, +1] score reliable even on heavily skewed datasets.
\sigma'(z) = \sigma(z)(1 - \sigma(z)), \quad \mathrm{ReLU}'(z) = \begin{cases} 1 & z > 0 \\ 0 & z < 0 \end{cases}
Sigmoid saturates near 0 and 1 (max derivative 0.25), causing vanishing gradients.
If 99% of samples are negative, a trivial model predicting all negatives scores 99% accuracy while achieving 0% recall. Use F1 score, PR-AUC, or MCC instead.
An oversized learning rate overshoots the valley minimum, causing loss to oscillate or diverge to infinity.
Smooth non-saturating activations like GELU and Swish avoid vanishing positive gradients while maintaining clean gradient flow near zero.