def __init__(self, configer=None):
    super(ContrastAuxCELoss, self).__init__()
    self.configer = configer
    ignore_index = (- 1)
    if (self.configer.exists('loss', 'params') and ('ce_ignore_index' in self.configer.get('loss', 'params'))):
        ignore_index = self.configer.get('loss', 'params')['ce_ignore_index']
    Log.info('ignore_index: {}'.format(ignore_index))
    self.loss_weight = self.configer.get('contrast', 'loss_weight')
    self.use_rmi = self.configer.get('contrast', 'use_rmi')
    if self.use_rmi:
        self.seg_criterion = FSAuxRMILoss(configer=configer)
    else:
        self.seg_criterion = FSAuxCELoss(configer=configer)
    self.contrast_criterion = PixelContrastLoss(configer=configer)
def __init__(self, configer=None):
    super(ContrastAuxCELoss, self).__init__()
    self.configer = configer
    ignore_index = (- 1)
    if (self.configer.exists('loss', 'params') and ('ce_ignore_index' in self.configer.get('loss', 'params'))):
        ignore_index = self.configer.get('loss', 'params')['ce_ignore_index']
    Log.info('ignore_index: {}'.format(ignore_index))
    self.loss_weight = self.configer.get('contrast', 'loss_weight')
    self.use_rmi = self.configer.get('contrast', 'use_rmi')
    if self.use_rmi:
        self.seg_criterion = FSAuxRMILoss(configer=configer)
    else:
        self.seg_criterion = FSAuxCELoss(configer=configer)
    self.contrast_criterion = PixelContrastLoss(configer=configer)