def __init__(self, alpha=1, mode="cosine"):
        """
        Adds a Distillation loss term on the features of the model,
        trying to maximize the cosine similarity between current and old features

        :param alpha: distillation hyperparameter. It can be either a float
                number or a list containing alpha for each experience.
        """
        super().__init__()
        self.alpha = alpha
        self.prev_model = None
        assert mode in ["mse", "cosine"]
        self.mode = mode

        Adds a Distillation loss term on the features of the model,
        trying to maximize the cosine similarity between current and old features

        :param alpha: distillation hyperparameter. It can be either a float
                number or a list containing alpha for each experience.
        
avalanche/training/plugins/feature_distillation.py