def track(self, model: BaseModel):
        """ Add current model predictions (usually the result of a batch) to the tracking
        """
        super().track(model)

        outputs = self._convert(model.get_output())
        targets = self._convert(model.get_labels())

        erp = torch.sqrt(((outputs - targets) / (targets + self._eps)) ** 2)
        self._merp = torch.mean(erp).item()

        self._mer = (
            torch.mean(F.normalize(outputs - targets, p=2, dim=-1))
            / torch.mean((F.normalize(targets, p=2, dim=-1) + self._eps))
        ).item()
Exemple #2
0
    def track(self, model: BaseModel):
        """ Add current model predictions (usually the result of a batch) to the tracking
        """
        super().track(model)

        outputs = self._convert(model.get_output())
        targets = self._convert(model.get_labels())
        assert outputs.shape[0] == len(targets)
        self._confusion_matrix.count_predicted_batch(targets,
                                                     np.argmax(outputs, 1))

        self._acc = 100 * self._confusion_matrix.get_overall_accuracy()
        self._macc = 100 * self._confusion_matrix.get_mean_class_accuracy()
        self._miou = 100 * self._confusion_matrix.get_average_intersection_union(
        )