def result(self) -> Dict[int, float]:
        """
        Compute the forgetting for all keys.

        :return: A dictionary containing keys whose value has been updated
            at least twice. The associated value is the difference between
            the first and last value recorded for that key.
        """

        ik = set(self.initial.keys())
        both_keys = list(ik.intersection(set(self.last.keys())))

        forgetting: Dict[int, float] = {}
        for k in both_keys:
            forgetting[k] = self.initial[k] - self.last[k]

        return forgetting

        Compute the forgetting for all keys.

        :return: A dictionary containing keys whose value has been updated
            at least twice. The associated value is the difference between
            the first and last value recorded for that key.
        
avalanche/evaluation/metrics/forgetting_bwt.py