class_docstr: Learning Without Forgetting.
  
  The method applies knowledge distilllation to mitigate forgetting.
  The teacher is the model checkpoint after the last experience.
docstr: Save a copy of the model after each experience and
  update self.prev_classes to include the newly learned classes.
  
  :param experience: current experience
  :param model: current model
docstr_tok: ["Save","a","copy","of","the","model","after","each","experience","and","update","self.prev_classes","to","include","the","newly","learned","classes",".",":","param","experience",":","current","experience",":","param","model",":","current","model"]
code: def update(self, experience, model):
      """Save a copy of the model after each experience and
      update self.prev_classes to include the newly learned classes.
  
      :param experience: current experience
      :param model: current model
      """
  
      self.expcount += 1
      self.prev_model = copy.deepcopy(model)
      task_ids = experience.dataset.targets_task_labels.uniques
  
      for task_id in task_ids:
          task_data = experience.dataset.task_set[task_id]
          pc = set(task_data.targets.uniques)
  
          if task_id not in self.prev_classes_by_task:
              self.prev_classes_by_task[task_id] = pc
          else:
              self.prev_classes_by_task[
                  task_id
              ] = self.prev_classes_by_task[task_id].union(pc)
  
imports: import copy
  from collections import defaultdict
  from typing import List
  import torch
  import torch.nn.functional
  from avalanche.models import MultiTaskModule, avalanche_forward
label_desc: Use image node_id 5 for calling the LearningWithoutForgetting obj's underlying member method code with example usage: obj.update(experience, model) without return types