def compute_loss(self, x: np.ndarray, y: np.ndarray, **kwargs) -> np.ndarray:
        """
        Compute the loss of the regressor for samples `x`. If loss_fn not provided at init, MSE loss is computed.

        :param x: Input samples.
        :param y: Target values.
        :return: Loss values.
        """
        predicted = self.predict(x)
        return self.compute_loss_from_predictions(y, predicted)

        Compute the loss of the regressor for samples `x`. If loss_fn not provided at init, MSE loss is computed.

        :param x: Input samples.
        :param y: Target values.
        :return: Loss values.
        
art/estimators/regression/blackbox.py