EasyDeepLearn

How should the output head be designed for a regression task with a strictly positive target?

medium

Answer

  • Options: (1) predict log(y)\operatorname{log}(y) and exponentiate — implicit positivity, natural for right-skewed targets; (2) apply exp()\operatorname{exp}() or softplus at the output to guarantee positivity; (3) predict a mean of a Gamma/log-normal distribution via a GLM-style head.
  • Never use identity output with MSE if y can only be positive — the model will predict negatives during training which then contribute noise.
Check yourself — multiple choice
  • Use identity output with MSE
  • Predict log(y)\operatorname{log}(y) or apply softplus / exp so predictions are guaranteed positive
  • Always add ReLU at the output
  • Only use classification instead

Positive target ⇒ log(y)\operatorname{log}(y) trick or softplus/exp at output ⇒ no negative predictions.

#fundamentals#losses

Practise Deep Learning

214 interview questions in this topic.

Related questions