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  

  

posted @ 2021-02-22 09:46  皮卡皮卡妞  阅读(189)  评论(0编辑  收藏  举报