Introduction

Deep learning runs exact ideas on finite machines.

That means the model does not only have mathematical behavior. It also has numerical behavior. Values can overflow, underflow, round, become NaN, or become infinite.

dtype choice trades memory, speed, range, and precisionFP32more precisionmore memoryFP16less memorynarrower rangeBF16less memorywider rangelower precision can be faster, but stability needs care
Deep learning often trades exactness for speed and memory, then uses stability techniques to stay reliable.

The Mathematics path introduced numerical computation. This chapter applies that habit to deep learning: logits, softmax, losses, gradients, normalization, and mixed precision.

The goal is practical. When training fails numerically, you should know what to inspect and which stable rewrite to try first.