              list of all loss keys for all sessions is returned
          """
          if session_id is None:
              retval = list(set(loss_key
                                for session in self._state["sessions"].values()
                                for loss_key in session["loss_names"]))
          else:
              retval = self._state["sessions"][str(session_id)]["loss_names"]
          return retval
  
  
 
</s> remove             retval = self._state["sessions"][str(session_id)]["loss_names"]
 </s> add             retval = loss_keys[session_id] </s> remove             for idx in range(len(side_outputs)):
                # First output is always face. Subsequent outputs are masks
                loss_name = f"face_{side}" if idx == 0 else f"mask_{side}"
                loss_name = loss_name if idx < 2 else f"{loss_name}_{idx}"
 </s> add             layer_name = side_outputs[0][0]

            output_config = next(layer for layer in config["layers"]
                                 if layer["name"] == layer_name)["config"]
            layer_outputs = self._get_outputs(output_config)
            for output in layer_outputs:  # Drill into sub-model to get the actual output names
                loss_name = output[0][0]
                if not split_output:  # Rename losses to reflect the side's output
                    loss_name = f"{loss_name.replace('_both', '')}_{side}" </s> remove         outputs = np.array(serializer.unmarshal(struct)["config"]["output_layers"])
        logger.debug("Obtained model outputs: %s, shape: %s", outputs, outputs.shape)
        if outputs.ndim == 2:  # Insert extra dimension for non learn mask models
            outputs = np.expand_dims(outputs, axis=1)
            logger.debug("Expanded dimensions for non-learn_mask model. outputs: %s, shape: %s",
                         outputs, outputs.shape)
        for side_outputs, side in zip(outputs, ("a", "b")):
 </s> add         config = serializer.unmarshal(struct)["config"]
        model_outputs = self._get_outputs(config)
        split_output = len(np.unique(model_outputs[..., 1])) == 1

        for side_outputs, side in zip(model_outputs, ("a", "b")):
                              for session in loss_keys.values()
                              for loss_key in session))
              list of all loss keys for all sessions is returned
          """
          if session_id is None:
              retval = list(set(loss_key
                              for session in loss_keys.values()
                              for loss_key in session))
                              for session in loss_keys.values()
                              for loss_key in session))
          else:
              retval = self._state["sessions"][str(session_id)]["loss_names"]
          return retval
  
  
keep keep keep keep replace replace keep keep keep keep keep
 lib.gui.stats - Read loss names from model config output rather than state file 
lib/gui/analysis/stats.py