class_docstr: Memory Aware Synapses (MAS) plugin.
  
  Similarly to EWC, the MAS plugin computes the importance of each
  parameter at the end of each experience. The approach computes
  importance via a second pass on the dataset. MAS does not require
  supervision and estimates importance using the gradients of the
  L2 norm of the output. Importance is then used to add a penalty
  term to the loss function.
  
  Technique introduced in:
  "Memory Aware Synapses: Learning what (not) to forget"
  by Aljundi et. al (2018).
  
  Implementation based on FACIL, as in:
  https://github.com/mmasana/FACIL/blob/master/src/approach/mas.py
class_docstr_tok: ["Memory","Aware","Synapses","(","MAS",")","plugin",".","Similarly","to","EWC",",","the","MAS","plugin","computes","the","importance","of","each","parameter","at","the","end","of","each","experience",".","The","approach","computes","importance","via","a","second","pass","on","the","dataset",".","MAS","does","not","require","supervision","and","estimates","importance","using","the","gradients","of","the","L2","norm","of","the","output",".","Importance","is","then","used","to","add","a","penalty","term","to","the","loss","function",".","Technique","introduced","in",":","''","Memory","Aware","Synapses",":","Learning","what","(","not",")","to","forget","''","by","Aljundi","et",".","al","(","2018",")",".","Implementation","based","on","FACIL",",","as","in",":","https",":","\/\/github.com\/mmasana\/FACIL\/blob\/master\/src\/approach\/mas.py"]
docstr: :param lambda_reg: hyperparameter weighting the penalty term
         in the loss.
  :param alpha: hyperparameter used to update the importance
         by also considering the influence in the previous
         experience.
  :param verbose: when True, the computation of the influence
         shows a progress bar using tqdm.
docstr_tok: [":","param","lambda_reg",":","hyperparameter","weighting","the","penalty","term","in","the","loss",".",":","param","alpha",":","hyperparameter","used","to","update","the","importance","by","also","considering","the","influence","in","the","previous","experience",".",":","param","verbose",":","when","True",",","the","computation","of","the","influence","shows","a","progress","bar","using","tqdm","."]
code: def __init__(
      self, lambda_reg: float = 1.0, alpha: float = 0.5, verbose=False
  ):
      """
      :param lambda_reg: hyperparameter weighting the penalty term
             in the loss.
      :param alpha: hyperparameter used to update the importance
             by also considering the influence in the previous
             experience.
      :param verbose: when True, the computation of the influence
             shows a progress bar using tqdm.
      """
  
      # Init super class
      super().__init__()
  
      # Regularization Parameters
      self._lambda = lambda_reg
      self.alpha = alpha
  
      # Model parameters
      self.params: Union[Dict, None] = None
      self.importance: Union[Dict, None] = None
  
      # Progress bar
      self.verbose = verbose
  
file_path: avalanche/avalanche/training/plugins/mas.py
imports: from tqdm.auto import tqdm
  from typing import Dict, Union
  from torch.utils.data import DataLoader
  import torch
  from avalanche.models.utils import avalanche_forward
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.utils import copy_params_dict, zerolike_params_dict, ParamData
label_desc: Use image node_id 1 to create a new MASPlugin object from inherited base classes: SupervisedPlugin with example: obj = MASPlugin(lambda_reg, alpha, verbose)