def __init__(
        self,
        *,
        model: Module,
        optimizer: Optimizer,
        criterion: CriterionType = CrossEntropyLoss(),
        mem_size=200,
        batch_size_mem=10,
        n_inner_steps=5,
        beta=0.1,
        gamma=0.1,
        train_mb_size: int = 1,
        train_epochs: int = 1,
        eval_mb_size: int = 1,
        device: Union[str, torch.device] = "cpu",
        plugins: Optional[Sequence["SupervisedPlugin"]] = None,
        evaluator: Union[
            EvaluationPlugin, Callable[[], EvaluationPlugin]
        ] = default_evaluator,
        eval_every=-1,
        peval_mode="epoch",
        **kwargs
    ):
        """Implementation of Look-ahead MAML (LaMAML) algorithm in Avalanche
            using Higher library for applying fast updates.

        :param model: PyTorch model.
        :param optimizer: PyTorch optimizer.
        :param criterion: loss function.
        :param mem_size: maximum size of the buffer.
        :param batch_size_mem: number of samples to retrieve from buffer
            for each sample.
        :param n_inner_steps: number of inner updates per sample.
        :param beta: coefficient for within-batch Reptile update.
        :param gamma: coefficient for within-task Reptile update.

        """
        super().__init__(
            model=model,
            optimizer=optimizer,
            criterion=criterion,
            train_mb_size=train_mb_size,
            train_epochs=train_epochs,
            eval_mb_size=eval_mb_size,
            device=device,
            plugins=plugins,
            evaluator=evaluator,
            eval_every=eval_every,
            peval_mode=peval_mode,
            **kwargs
        )

        self.buffer = MERBuffer(
            mem_size=mem_size,
            batch_size_mem=batch_size_mem,
            device=self.device,
        )
        self.n_inner_steps = n_inner_steps
        self.beta = beta
        self.gamma = gamma
Implementation of Look-ahead MAML (LaMAML) algorithm in Avalanche
            using Higher library for applying fast updates.

        :param model: PyTorch model.
        :param optimizer: PyTorch optimizer.
        :param criterion: loss function.
        :param mem_size: maximum size of the buffer.
        :param batch_size_mem: number of samples to retrieve from buffer
            for each sample.
        :param n_inner_steps: number of inner updates per sample.
        :param beta: coefficient for within-batch Reptile update.
        :param gamma: coefficient for within-task Reptile update.

        
avalanche/training/supervised/mer.py