class_docstr: MultiTask Slimmed ResNet18.
class_docstr_tok: ["MultiTask","Slimmed","ResNet18","."]
code: def __init__(self, nclasses, nf=20):
      super().__init__()
      self.in_planes = nf
      block = BasicBlock
      num_blocks = [2, 2, 2, 2]
  
      self.conv1 = conv3x3(3, nf * 1)
      self.bn1 = nn.BatchNorm2d(nf * 1)
      self.layer1 = self._make_layer(
          block, nf * 1, num_blocks[0], stride=1
      )
      self.layer2 = self._make_layer(
          block, nf * 2, num_blocks[1], stride=2
      )
      self.layer3 = self._make_layer(
          block, nf * 4, num_blocks[2], stride=2
      )
      self.layer4 = self._make_layer(
          block, nf * 8, num_blocks[3], stride=2
      )
      self.linear = MultiHeadClassifier(
          nf * 8 * BasicBlock.expansion, nclasses
      )
  
imports: import torch.nn
  from torch.nn.functional import relu, avg_pool2d
  from avalanche.models import MultiHeadClassifier, MultiTaskModule, DynamicModule
label_desc: Use image node_id 1 to create a new MTSlimResNet18 object from inherited base classes: MultiTaskModule, DynamicModule with example: obj = MTSlimResNet18(nclasses, nf)