def __init__(
        self,
        feature_extractor,
        temp: float = 0.1,
        base_temp: float = 0.07,
        same_task_neg: bool = True,
        device: str = "cpu",
    ):
        """
        ER_AML criterion constructor.
        :param feature_extractor: Model able to map an input in a latent space.
        :param temp: Supervised contrastive temperature.
        :param base_temp: Supervised contrastive base temperature.
        :param same_task_neg: Option to remove negative samples of different tasks.
        :param device: Accelerator used to speed up the computation.
        """
        self.device = device
        self.feature_extractor = feature_extractor
        self.temp = temp
        self.base_temp = base_temp
        self.same_task_neg = same_task_neg

        ER_AML criterion constructor.
        :param feature_extractor: Model able to map an input in a latent space.
        :param temp: Supervised contrastive temperature.
        :param base_temp: Supervised contrastive base temperature.
        :param same_task_neg: Option to remove negative samples of different tasks.
        :param device: Accelerator used to speed up the computation.
        
avalanche/training/regularization.py