But as you can see, my above code is like MAE:

So if use MAE, the grad of each variable has no relation with the final loss, why people still use it ?  (since the grad of yi is constant)


image.png785×102 7.73 KB

And so is cross entropy loss  (since the grad of yi is  tar/yy , not containing loss)