class_docstr: Reduced ResNet 32
  
  This network architecture is an adaptation of ResNet for smaller
  input size. The number of blocks can be modified in this line by
  changing n=5 to n=3 for ResNet-20, and n=9 for ResNet-56.
  
  Implementation based on FACIL, as in:
  https://github.com/mmasana/FACIL/blob/master/src/networks/resnet32.py
class_docstr_tok: ["Reduced","ResNet","32","This","network","architecture","is","an","adaptation","of","ResNet","for","smaller","input","size",".","The","number","of","blocks","can","be","modified","in","this","line","by","changing","n=5","to","n=3","for","ResNet-20",",","and","n=9","for","ResNet-56",".","Implementation","based","on","FACIL",",","as","in",":","https",":","\/\/github.com\/mmasana\/FACIL\/blob\/master\/src\/networks\/resnet32.py"]
code: def __init__(self, block, layers, num_classes=10):
      self.inplanes = 16
      super(ResNet, self).__init__()
      self.conv1 = nn.Conv2d(
          3, 16, kernel_size=3, stride=1, padding=1, bias=False
      )
      self.bn1 = nn.BatchNorm2d(16)
      self.relu = nn.ReLU(inplace=True)
      self.layer1 = self._make_layer(block, 16, layers[0])
      self.layer2 = self._make_layer(block, 32, layers[1], stride=2)
      self.layer3 = self._make_layer(block, 64, layers[2], stride=2)
      self.avgpool = nn.AvgPool2d(8, stride=1)
      # last classifier layer (head) with as many outputs as classes
      self.fc = nn.Linear(64 * block.expansion, num_classes)
      # and `head_var` with the name of the head, so it can be
      # removed when doing incremental learning experiments
      self.head_var = "fc"
  
      for m in self.modules():
          if isinstance(m, nn.Conv2d):
              nn.init.kaiming_normal_(
                  m.weight, mode="fan_out", nonlinearity="relu"
              )
          elif isinstance(m, nn.BatchNorm2d):
              nn.init.constant_(m.weight, 1)
              nn.init.constant_(m.bias, 0)
  
file_path: avalanche/avalanche/models/resnet32.py
imports: import torch.nn
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: nn with example: obj = ResNet(block, layers, num_classes)