class_docstr: Synaptic Intelligence plugin.
  
  This is the Synaptic Intelligence PyTorch implementation of the
  algorithm described in the paper
  "Continuous Learning in Single-Incremental-Task Scenarios"
  (https://arxiv.org/abs/1806.08568)
  
  The original implementation has been proposed in the paper
  "Continual Learning Through Synaptic Intelligence"
  (https://arxiv.org/abs/1703.04200).
  
  This plugin can be attached to existing strategies to achieve a
  regularization effect.
  
  This plugin will require the strategy `loss` field to be set before the
  `before_backward` callback is invoked. The loss Tensor will be updated to
  achieve the S.I. regularization effect.
code: def create_syn_data(
      model: Module,
      ewc_data: EwcDataType,
      syn_data: SynDataType,
      excluded_parameters: Set[str],
  ):
      params = SynapticIntelligencePlugin.allowed_parameters(
          model, excluded_parameters
      )
  
      for param_name, param in params:
          if param_name not in ewc_data[0]:
              # new parameter
              ewc_data[0][param_name] = ParamData(
                  param_name, param.flatten().shape
              )
              ewc_data[1][param_name] = ParamData(
                  f"imp_{param_name}", param.flatten().shape
              )
              syn_data["old_theta"][param_name] = ParamData(
                  f"old_theta_{param_name}", param.flatten().shape
              )
              syn_data["new_theta"][param_name] = ParamData(
                  f"new_theta_{param_name}", param.flatten().shape
              )
              syn_data["grad"][param_name] = ParamData(
                  f"grad{param_name}", param.flatten().shape
              )
              syn_data["trajectory"][param_name] = ParamData(
                  f"trajectory_{param_name}", param.flatten().shape
              )
              syn_data["cum_trajectory"][param_name] = ParamData(
                  f"cum_trajectory_{param_name}", param.flatten().shape
              )
          elif ewc_data[0][param_name].shape != param.shape:
              # parameter expansion
              ewc_data[0][param_name].expand(param.flatten().shape)
              ewc_data[1][param_name].expand(param.flatten().shape)
              syn_data["old_theta"][param_name].expand(
                  param.flatten().shape
              )
              syn_data["new_theta"][param_name].expand(
                  param.flatten().shape
              )
              syn_data["grad"][param_name].expand(param.flatten().shape)
              syn_data["trajectory"][param_name].expand(
                  param.flatten().shape
              )
              syn_data["cum_trajectory"][param_name].expand(
                  param.flatten().shape
              )
  
imports: from fnmatch import fnmatch
  from typing import Optional, Sequence, Any, Set, List, Tuple, Dict, Union, TYPE_CHECKING
  import numpy
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torch.nn.modules.batchnorm import _NormBase
  from .ewc import EwcDataType, ParamDict
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.utils import get_layers_and_params, ParamData
label_desc: Use image node_id 8 for calling the SynapticIntelligencePlugin obj's underlying member method code with example usage: obj.create_syn_data(model, ewc_data, syn_data, excluded_parameters) without return types