class_docstr: The expert classifier which sits behind the autoencoder.
  Each expert classifieris usually a pre-trained AlexNet fine-tuned
  on a specific task. The final classification layer is replaced and
  sized based on the number of classes for a task.
class_docstr_tok: ["The","expert","classifier","which","sits","behind","the","autoencoder",".","Each","expert","classifieris","usually","a","pre-trained","AlexNet","fine-tuned","on","a","specific","task",".","The","final","classification","layer","is","replaced","and","sized","based","on","the","number","of","classes","for","a","task","."]
docstr: :param num_classes: number of classes this expert model will classify
  :param arch: the architecture to use from torchvision.models
  :param device: gpu or cpu
  :param pretrained_flag: determines if torchvision model is pre-trained
  :param provided_template: the expert model to copy the backbone from,
  defaults to None
docstr_tok: [":","param","num_classes",":","number","of","classes","this","expert","model","will","classify",":","param","arch",":","the","architecture","to","use","from","torchvision.models",":","param","device",":","gpu","or","cpu",":","param","pretrained_flag",":","determines","if","torchvision","model","is","pre-trained",":","param","provided_template",":","the","expert","model","to","copy","the","backbone","from",",","defaults","to","None"]
code: def __init__(
      self,
      num_classes,
      arch,
      device,
      pretrained_flag,
      provided_template=None,
  ):
      """
      :param num_classes: number of classes this expert model will classify
      :param arch: the architecture to use from torchvision.models
      :param device: gpu or cpu
      :param pretrained_flag: determines if torchvision model is pre-trained
      :param provided_template: the expert model to copy the backbone from,
      defaults to None
      """
      super().__init__()
  
      self.device = device
      self.num_classes = num_classes
  
      # Select pretrained AlexNet for feature backbone
      base_template = models.__dict__[arch](
          weights=(
              "AlexNet_Weights.IMAGENET1K_V1"
              if pretrained_flag
              else "AlexNet_Weights.NONE"
          )
      ).to(device)
  
      # Set the feature module from provided template
      if provided_template is None:
          self.feature_module = deepcopy(
              base_template._modules["features"]
          )
  
      # Use base template if nothing provided
      else:
          self.feature_module = deepcopy(
              provided_template.feature_module
          )
  
      # Set avgpool layer
      self.avg_pool = deepcopy(base_template._modules["avgpool"])
  
      # Flattener
      self.flatten = Flatten()
  
      # Classifier module
      self.classifier_module = deepcopy(
          base_template._modules["classifier"]
      )
  
      # Customize final layer for  the number of classes in the data
      original_classifier_input_dim = self.classifier_module[
          -1
      ].in_features
      self.classifier_module[-1] = nn.Linear(
          original_classifier_input_dim, self.num_classes
      )
  
      for param in self.parameters():
          param.requires_grad = True
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import sigmoid
  from torch.nn.functional import mse_loss, softmax
  from torchvision import transforms
  import torchvision.models
  from .utils import FeatureExtractorBackbone
  from avalanche.models import MultiTaskModule
  from avalanche.models.utils import Flatten
  from avalanche.benchmarks.scenarios.generic_scenario import CLExperience
label_desc: Use image node_id 1 to create a new ExpertModel object from inherited base classes: nn with example: obj = ExpertModel(num_classes, arch, device, pretrained_flag, provided_template)