class_docstr: ExML scenario on CoRE50.
  
  The pretrained models and class splits are taken from
  https://arxiv.org/abs/2112.06511
docstr: Init.
  
  :param scenario: The desired CoRE50 scenario. Supports 'nc', 'ni', and
      'joint', which is the scenario with a single experience.
  :param run_id: an integer in [0, 4]. Each run uses a different set of
      expert models and data splits.
docstr_tok: ["Init",".",":","param","scenario",":","The","desired","CoRE50","scenario",".","Supports","'nc","'",",","'ni","'",",","and","'joint","'",",","which","is","the","scenario","with","a","single","experience",".",":","param","run_id",":","an","integer","in","[","0",",","4","]",".","Each","run","uses","a","different","set","of","expert","models","and","data","splits","."]
code: def __init__(self, scenario="ni", run_id=0):
      """Init.
  
      :param scenario: The desired CoRE50 scenario. Supports 'nc', 'ni', and
          'joint', which is the scenario with a single experience.
      :param run_id: an integer in [0, 4]. Each run uses a different set of
          expert models and data splits.
      """
  
      assert scenario in {
          "ni",
          "joint",
          "nc",
      }, "`scenario` argument must be one of {'ni', 'joint', 'nc'}."
  
      core50_normalization = Normalize(
          mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
      )
      core50_train_transforms = Compose(
          [
              RandomHorizontalFlip(p=0.5),
              RandomCrop(size=128, padding=1),
              RandomRotation(15),
              ToTensor(),
              core50_normalization,
          ]
      )
      core50_eval_transforms = Compose(
          [CenterCrop(size=128), ToTensor(), core50_normalization]
      )
  
      if scenario == "ni":
          benchmark = CORe50(
              scenario="ni",
              train_transform=core50_train_transforms,
              eval_transform=core50_eval_transforms,
              run=run_id,
          )
      elif scenario == "nc":
          benchmark = CORe50(
              scenario="nc",
              train_transform=core50_train_transforms,
              eval_transform=core50_eval_transforms,
              run=run_id,
          )
      elif scenario == "joint":
          core50nc = CORe50(scenario="nc")
          train_cat = concat_datasets(
              [e.dataset for e in core50nc.train_stream]
          )
          test_cat = concat_datasets(
              [e.dataset for e in core50nc.test_stream]
          )
          benchmark = nc_benchmark(
              train_cat, test_cat, n_experiences=1, task_labels=False
          )
      else:
          assert False, "Should never get here."
  
      ll = len(benchmark.train_stream)
      base_model = mobilenet_v2()
      base_model.classifier = nn.Sequential(
          nn.Dropout(0.2),
          nn.Linear(base_model.last_channel, 50),
      )
      experts = _load_expert_models(
          f"{scenario}_core50", base_model, run_id, ll
      )
      super().__init__(benchmark, experts)
  
imports: import urllib
  import os
  import torch
  from torch import nn
  from torch.utils.data import DataLoader
  from torchvision.models import mobilenet_v2
  from torchvision.transforms import RandomHorizontalFlip, RandomCrop, RandomRotation, ToTensor, CenterCrop, Normalize, Resize
  from avalanche.benchmarks.classic.ccifar10 import SplitCIFAR10
  from avalanche.benchmarks.classic.cmnist import SplitMNIST
  from avalanche.benchmarks.classic.core50 import CORe50
  from avalanche.benchmarks.datasets.dataset_utils import default_dataset_location
  from avalanche.benchmarks.utils.utils import concat_datasets
  from avalanche.models import LeNet5, SlimResNet18
  from torchvision.transforms import Compose
  from avalanche.evaluation.metrics import TaskAwareAccuracy
  from avalanche.benchmarks import ExModelCLScenario, nc_benchmark
  import copy
  import urllib.request
label_desc: Use image node_id 1 to create a new ExMLCoRE50 object from inherited base classes: ExModelCLScenario with example: obj = ExMLCoRE50(scenario, run_id)