Why does the object loss in yolox calculate the loss of all predictions?
I'm reading the source code of yolox , when I scan the code about loss computation,the reg loss and cls loss just cauculate the loss of predition which was selected by a series of strategies,but things going to be different in obj loss , I found the object loss contains the loss of all predictions,I really can't understand it ,can anybody explain it for me ? thanks very much !!
here is the code

Your issue is not quiet clear for me. In my opinion, cls and reg loss only care about foreground, but objectness affect both foreground area and background area, code here is intuitive.
Your issue is not quiet clear for me. In my opinion, cls and reg loss only care about foreground, but objectness affect both foreground area and background area, code here is intuitive.
Why the obj loss is scaled by the number of foreground samples rather than the number of total samples? many thanks!
To make the loss more stable and your training process could be more smooth. If your like, you could alos use foreground ema value as scaled number. @zye1996