Skip to content
RED SAGSkills
easy5 pts · first answer countsdeep-learningnumerical-stabilityloss-functions

NaN from a hand-written log loss

A custom loss computes -(y * torch.log(p)).sum() and turns NaN when some p values reach exactly 0. What is the simplest fix?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions