class_docstr: A plugin calling PackNet's pruning and freezing procedures at the
  appropriate times. This plugin can only be used with `PackNet` models.
class_docstr_tok: ["A","plugin","calling","PackNet","'s","pruning","and","freezing","procedures","at","the","appropriate","times",".","This","plugin","can","only","be","used","with","`","PackNet","`","models","."]
code: def before_training_exp(
      self, strategy: "BaseSGDTemplate", *args, **kwargs
  ):
      # Reset the optimizer to prevent momentum from affecting the pruned
      # parameters
      strategy.optimizer = strategy.optimizer.__class__(
          strategy.model.parameters(), **strategy.optimizer.defaults
      )
  
imports: import typing
  import torch
  import torch.nn
  from torch import Tensor
  from torch.nn import functional
  from abc import ABC, abstractmethod
  from enum import Enum
  from avalanche.core import BaseSGDPlugin, Template
  from avalanche.models.dynamic_modules import MultiTaskModule
  from avalanche.models.simple_mlp import SimpleMLP
  from typing import Union
  from avalanche.training.templates.base_sgd import BaseSGDTemplate
label_desc: Use image node_id 3 for calling the PackNetPlugin obj's underlying member method code with example usage: obj.before_training_exp(strategy) without return types