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 update_ewc_data(
      net,
      ewc_data: EwcDataType,
      syn_data: SynDataType,
      clip_to: float,
      excluded_parameters: Set[str],
      c=0.0015,
      eps: float = 0.0000001,
  ):
      SynapticIntelligencePlugin.extract_weights(
          net, syn_data["new_theta"], excluded_parameters
      )
  
      for param_name in syn_data["cum_trajectory"]:
          syn_data["cum_trajectory"][param_name].data += (
              c
              * syn_data["trajectory"][param_name].data
              / (
                  np.square(
                      syn_data["new_theta"][param_name].data
                      - ewc_data[0][param_name].data
                  )
                  + eps
              )
          )
  
      for param_name in syn_data["cum_trajectory"]:
          ewc_data[1][param_name].data = torch.empty_like(
              syn_data["cum_trajectory"][param_name].data
          ).copy_(-syn_data["cum_trajectory"][param_name].data)
  
      # change sign here because the Ewc regularization
      # in Caffe (theta - thetaold) is inverted w.r.t. syn equation [4]
      # (thetaold - theta)
      for param_name in ewc_data[1]:
          ewc_data[1][param_name].data = torch.clamp(
              ewc_data[1][param_name].data, max=clip_to
          )
          ewc_data[0][param_name].data = syn_data["new_theta"][
              param_name
          ].data.clone()
  
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 15 for calling the SynapticIntelligencePlugin obj's underlying member method code with example usage: obj.update_ewc_data(net, ewc_data, syn_data, clip_to, excluded_parameters, c, eps) without return types