AI
Notes on AI. Learning notes on how models train, evaluate and serve.. Daily learning notes on machine learning fundamentals, evaluation and model…
- A small filter, an entire image — Convolution reuses local filters across an image. Parameter count stays fixed while activation memory grows with image area.
- Accuracy lies when the rare case is the one that matters — A worked confusion matrix shows how recall, false-positive rate and prevalence determine alert quality and operator workload.
- Attention matches keys and mixes values — Queries match keys; the resulting weights mix values. One numerical example exposes the roles, shapes and limits.
- Why a classifier learns from logits, not argmax — Argmax loses the score differences needed for ordinary gradient training. Softmax and cross entropy preserve a useful signal.
- A similarity score is not a probability — Dot product and cosine can rank the same vectors differently. Similarity also depends on compatible encoders, normalization and versioning.
- Fewer bits, the same number of weights — INT8 changes how weights are represented. Scale, rounding and clipping explain both the storage benefit and the accuracy trade-off.
- Who decided that 0.5 was the right threshold? — The same model can justify different thresholds when error costs change. Calibration and review capacity belong in the decision.
- Ten Linear layers still need nonlinearity — Stacking affine layers still produces an affine map. ReLU changes that; a two-unit XOR makes the difference explicit.
- Accuracy lies when the rare case is the one that matters — If one case in a hundred is the one you care about, a model that never finds it is 99% accurate. Precision and recall say what accuracy hides.
- A model that remembers has not learned — A model can score perfectly on what it has seen and fail on everything else. Splitting the data three ways is how you find out which one you built.
- Training and inference are two different jobs — A training step is forward, loss, backward, update. Serving needs only the forward pass, and two separate switches control that.
- Did the model succeed, or did the test leak the answers? — Shuffling frames into train and test looks tidy and still leaks. The split boundary should match what is new at use time.
- Why a GPU likes batches, and your user may not — Batching shares weights across requests and raises throughput, but each request still waits for the whole batch.