class_docstr: Bias Correction (BiC) plugin.
  
  Technique introduced in:
  "Wu, Yue, et al. "Large scale incremental learning." Proceedings
  of the IEEE/CVF Conference on Computer Vision and Pattern
  Recognition. 2019"
  
  Implementation based on FACIL, as in:
  https://github.com/mmasana/FACIL/blob/master/src/approach/bic.py
code: def before_backward(self, strategy, **kwargs):
      # Distill
      task_id = strategy.clock.train_exp_counter
  
      if self.model_old is not None:
          out_old = self.model_old(strategy.mb_x.to(strategy.device))
          out_new = strategy.model(strategy.mb_x.to(strategy.device))
  
          old_clss = []
          for c in self.class_to_tasks.keys():
              if self.class_to_tasks[c] < task_id:
                  old_clss.append(c)
  
          loss_dist = self.cross_entropy(
              out_new[:, old_clss], out_old[:, old_clss]
          )
          if self.lamb == -1:
              lamb = len(old_clss) / len(self.seen_classes)
              return (1.0 - lamb) * strategy.loss + lamb * loss_dist
          else:
              return strategy.loss + self.lamb * loss_dist
  
imports: from collections import defaultdict
  from typing import Dict, List, Optional, TYPE_CHECKING, Sequence, Set, SupportsInt
  from copy import deepcopy
  import torch
  from torch.utils.data import DataLoader
  from torch.optim.lr_scheduler import MultiStepLR
  from avalanche.benchmarks.utils import _taskaware_classification_subset, _concat_taskaware_classification_datasets
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.benchmarks.utils.data_loader import ReplayDataLoader
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.storage_policy import ExemplarsBuffer, ExperienceBalancedBuffer, ReservoirSamplingBuffer
  from avalanche.models.dynamic_modules import MultiTaskModule
  from avalanche.models.bic_model import BiasLayer
label_desc: Use image node_id 7 for calling the BiCPlugin obj's underlying member method code with example usage: obj.before_backward(strategy) and returns: unknown, unknown