          learning_rate = self.config.get("learning_rate", 5e-5)
          optimizer = self.get_optimizer(lr=learning_rate, beta_1=0.5, beta_2=0.999)
  
          for side, model in self.predictors.items():
              mask = [inp for inp in model.inputs if inp.name.startswith("mask")]
              loss_names = ["loss"]
              loss_funcs = [self.loss_function(mask, side, initialize)]
              if mask:
                  loss_names.append("mask_loss")
                  loss_funcs.append(self.mask_loss_function(side, initialize))
              model.compile(optimizer=optimizer, loss=loss_funcs)
  
              if len(loss_names) > 1:
                  loss_names.insert(0, "total_loss")
              if initialize:
                  self.state.add_session_loss_names(side, loss_names)
                  self.history[side] = list()
          logger.debug("Compiled Predictors. Losses: %s", loss_names)
  
 
</s> remove                 self.state.add_session_loss_names(side, loss_names)
 </s> add                 self.state.add_session_loss_names(side, loss.names) </s> remove         logger.debug("Compiled Predictors. Losses: %s", loss_names)
 </s> add         logger.debug("Compiled Predictors. Losses: %s", loss.names) </s> remove     def loss_function(self, mask, side, initialize):
        """ Set the loss function
            Side is input so we only log once """
        if self.config.get("dssim_loss", False):
            if side == "a" and not self.predict and initialize:
                logger.verbose("Using DSSIM Loss")
            loss_func = DSSIMObjective()
        else:
            if side == "a" and not self.predict and initialize:
                logger.verbose("Using Mean Absolute Error Loss")
            loss_func = losses.mean_absolute_error

        if mask and self.config.get("penalized_mask_loss", False):
            loss_mask = mask[0]
            if side == "a" and not self.predict and initialize:
                logger.verbose("Penalizing mask for Loss")
            loss_func = PenalizedLoss(loss_mask, loss_func)
        return loss_func

    def mask_loss_function(self, side, initialize):
        """ Set the mask loss function
            Side is input so we only log once """
        if side == "a" and not self.predict and initialize:
            logger.verbose("Using Mean Squared Error Loss for mask")
        mask_loss_func = losses.mean_squared_error
        return mask_loss_func

 </s> add  </s> remove             if loss_key.startswith("loss"):
 </s> add             if loss_key.startswith("total"): </s> remove         if "mask_out" in output_network.output_names:
            mask_idx = output_network.output_names.index("mask_out")
            mask_shape = output_network.output_shapes[mask_idx]
 </s> add         mask_idx = [idx for idx, name in enumerate(output_network.output_names)
                    if name.startswith("mask")]
        if mask_idx:
            mask_shape = output_network.output_shapes[mask_idx[0]]
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
          learning_rate = self.config.get("learning_rate", 5e-5)
          optimizer = self.get_optimizer(lr=learning_rate, beta_1=0.5, beta_2=0.999)
  
          for side, model in self.predictors.items():
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
            mask_input = [inp for inp in model.inputs if inp.name.startswith("mask")]
            loss = Loss(side, model.outputs, mask_input, self.predict)
            model.compile(optimizer=optimizer, loss=loss.funcs)
              if initialize:
                  self.state.add_session_loss_names(side, loss_names)
                  self.history[side] = list()
          logger.debug("Compiled Predictors. Losses: %s", loss_names)
  
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Training: Add Multi-Output Support

- Name output nodes of models
- Add support for multiple outputs in models and in training
- Update loss output format for cli and gui
- Sort graphs tabs on training
- Fix analysis graph for new loss names
- Multi output support in convert 
plugins/train/model/_base.py