def pre_adapt(self, agent: Agent, exp: CLExperience):
        """Adapt the optimizer before training on the current experience."""
        self._optimized_param_id = update_optimizer(
            self.optim,
            dict(agent.model.named_parameters()),
            self._optimized_param_id,
            reset_state=self.reset_state,
            verbose=self.verbose,
        )
Adapt the optimizer before training on the current experience.
avalanche/models/dynamic_optimizers.py