NaN trap — debugging или safety mechanism, который обнаруживает, когда computation produces a not-a-number value. В машинном обучении NaN values могут указывать на numerical instability, invalid operations, exploding gradients или data quality problems.
When one number in your model becomes a NaN during training, which causes many or all other numbers in your model to eventually become a NaN. NaN is an abbreviation for N ot a Number.