def setup_losses_and_metrics(self):
        self.loss_metrics = self.config[a.loss_metric]
        self.loss_weights = self.config.get("loss_weights")

        if self.loss_weights is None and type(self.loss_metrics) is dict:
            self.loss_weights = [1.0 for _ in range(len(self.loss_metrics))]

        if type(self.config[a.metrics]) is list:
            self.metrics_name = [
                U.selectMetric(m) for m in self.config[a.metrics]
            ]
        else:

            def selectM(metric):
                if type(metric) is list:
                    return [U.selectMetric(m_i) for m_i in metric]
                else:
                    return U.selectMetric(metric)

            self.metrics_name = {
                n: selectM(m)
                for n, m in self.config[a.metrics].items()
            }
 def selectM(metric):
     if type(metric) is list:
         return [U.selectMetric(m_i) for m_i in metric]
     else:
         return U.selectMetric(metric)