def _task_relatedness(self, strategy: "SupervisedTemplate", error_dict, task_label):
        """Given a task label and error dictionary, returns a dictionary
        of relatedness between the autoencoder of the current task
        and all other tasks.
        """
        # Build a task relatedness dictionary
        relatedness_dict = OrderedDict()

        error_k = error_dict[str(task_label)]

        # Iterate through all reconstruction errros to obtain task_relatedness
        for task, error_a in error_dict.items():
            if task != str(task_label):
                relatedness_dict[str(task)] = 1 - ((error_a - error_k) / error_k)

        return relatedness_dict
Given a task label and error dictionary, returns a dictionary
        of relatedness between the autoencoder of the current task
        and all other tasks.
        
avalanche/training/supervised/expert_gate.py