class_docstr: From Scratch Training Plugin.
  
  This plugin resets the strategy's model weights and optimizer state after
  each experience. It expects the strategy to have a single model and
  optimizer. It can be used with the Naive strategy to produce
  "from-scratch training" baselines.
docstr: Called before `train` by the `BaseTemplate`.
docstr_tok: ["Called","before","`","train","`","by","the","`","BaseTemplate","`","."]
code: def before_training(self, strategy: BaseSGDTemplate, *args, **kwargs):
      """Called before `train` by the `BaseTemplate`."""
  
      # Save model's initial weights in the first experience training step
      if self.initial_weights is None:
          # Save initial weights
          self.initial_weights = deepcopy(strategy.model.state_dict())
  
file_path: avalanche/avalanche/training/plugins/from_scratch_training.py
imports: from copy import deepcopy
  from typing import Dict, Optional
  from torch import Tensor
  from avalanche.core import BaseSGDPlugin
  from avalanche.training.templates import BaseSGDTemplate
  from avalanche.models.dynamic_optimizers import reset_optimizer
label_desc: Use image node_id 2 for calling the FromScratchTrainingPlugin obj's underlying member method code with example usage: obj.before_training(strategy) without return types