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

        :return: a dictionary containing, for each key,
            the difference between the key value after training on the
            previous experience, and the key at random initialization.
        """

        forward_transfer: Dict[int, float] = {}

        previous_keys = set(self.previous.keys())
        for k in previous_keys:
            forward_transfer[k] = self.previous[k] - self.initial[k]

        return forward_transfer

        Compute the forward transfer for all keys.

        :return: a dictionary containing, for each key,
            the difference between the key value after training on the
            previous experience, and the key at random initialization.
        
avalanche/evaluation/metrics/forward_transfer.py