Example #1
0
 def get_metrics(self):
     all_of_metrics = {}
     for of_name, of_obj in self.output_features.items():
         all_of_metrics[of_name] = of_obj.get_metrics()
     all_of_metrics[COMBINED] = {
         LOSS: get_scalar_from_ludwig_metric(self.eval_loss_metric)
         + get_scalar_from_ludwig_metric(self.eval_additional_losses_metrics)
     }
     return all_of_metrics
Example #2
0
 def get_metrics(self):
     """Returns a dictionary of metrics for each output feature of the model."""
     all_of_metrics = {}
     for of_name, of_obj in self.output_features.items():
         all_of_metrics[of_name] = of_obj.get_metrics()
     all_of_metrics[COMBINED] = {
         LOSS:
         get_scalar_from_ludwig_metric(self.eval_loss_metric) +
         get_scalar_from_ludwig_metric(self.eval_additional_losses_metrics)
     }
     return all_of_metrics
Example #3
0
 def get_metrics(self):
     metric_vals = {}
     for metric_name, metric_fn in self.metric_functions.items():
         try:
             metric_vals[metric_name] = get_scalar_from_ludwig_metric(
                 metric_fn)
         except Exception as e:
             logger.error(
                 f"Caught exception computing metric: {metric_name}. Exception: {e}"
             )
     return metric_vals
Example #4
0
>>>>>>> upstream/master

    def get_metrics(self):
        all_of_metrics = {}
        for of_name, of_obj in self.output_features.items():
            all_of_metrics[of_name] = of_obj.get_metrics()
<<<<<<< HEAD
        all_of_metrics[COMBINED] = {
<<<<<<< HEAD
            #LOSS: self.eval_loss_metric.result().numpy()
=======
>>>>>>> upstream/master
            LOSS: self.eval_loss_metric.compute().detach().numpy().item()
        }
=======
        all_of_metrics[COMBINED] = {LOSS: get_scalar_from_ludwig_metric(self.eval_loss_metric)}
>>>>>>> upstream/master
        return all_of_metrics

    def reset_metrics(self):
        for of_obj in self.output_features.values():
            of_obj.reset_metrics()
<<<<<<< HEAD
        #self.eval_loss_metric.reset_states()
=======
>>>>>>> upstream/master
        self.eval_loss_metric.reset()

<<<<<<< HEAD
    def collect_weights(
            self,