Thanks for your reply. If I you Make Loss, I don’t need to write backward, right? My customized loss needs to compute IoU, density and other things, so how can I define my customized loss? thank you very much!
Answering your first question: What is the relationship between customized loss and metric? - there are no direct relationship between these two things. Loss is a number that DL algorithm tries to minimize, so it shows an error (in an abstract value) of the algorithm. The metric is something that makes sense for the meaning of the task and easy to interpret for a human.