Hi jjhh!



 jjhh:

I tested the function without minimum and maximum, but i still got the same gradients.


First, I do not get the same gradients using your new version of iou_loss().
Second, while your new iou_loss() still returns zero for the input parameters
given in your first post, this is no longer the minimum as iou_loss() can now
become negative.
If you believe otherwise please post a complete, runnable script, together with
its output, that demonstrates your result.
Best.
K. Frank