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","."]
docstr: When the initial training phase is over, prune the model and
  transition to the post-pruning phase.
docstr_tok: ["When","the","initial","training","phase","is","over",",","prune","the","model","and","transition","to","the","post-pruning","phase","."]
code: def before_training_epoch(
      self, strategy: "BaseSGDTemplate", *args, **kwargs
  ):
      """When the initial training phase is over, prune the model and
      transition to the post-pruning phase.
      """
      epoch = strategy.clock.train_exp_epochs
      model = self._get_model(strategy)
  
      if epoch == (self.total_epochs - self.post_prune_epochs):
          model.prune(
              self.prune_proportion(strategy.clock.train_exp_counter)
          )
  
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 4 for calling the PackNetPlugin obj's underlying member method code with example usage: obj.before_training_epoch(strategy) without return types