pytorch~多loss的选择
def mutil_max_loss_two(self,R_loss,O_loss): if R_loss>O_loss: O_loss=R_loss return O_loss def mutil_max_loss_three(self,M_loss,glass_loss,O_loss): if M_loss>O_loss: O_loss=M_loss if glass_loss>O_loss: O_loss=glass_loss return O_loss def mutil_max_loss_four(self,M_loss,R_loss,L_loss,O_loss): O_loss = O_loss*2 if R_loss>O_loss: O_loss=R_loss if M_loss>O_loss: O_loss=M_loss if L_loss>O_loss: O_loss=L_loss return O_loss def mutil_max_loss_five(self,M_loss,R_loss,L_loss,glass_loss,O_loss): O_loss = O_loss*10 if R_loss>O_loss: O_loss=R_loss if M_loss>O_loss: O_loss=M_loss if L_loss>O_loss: O_loss=L_loss if glass_loss>O_loss: O_loss=glass_loss return O_loss def mutil_sum_loss(self,R_loss,L_loss,O_loss): sum_loss = R_loss+L_loss+O_loss*2 return sum_loss