code: def __init__(
      self,
      nfilters=None,
      nclasses=None,
      nmasks=None,
      level=None,
      filter_size=None,
      linear=128,
      input_size=28,
      debug=False,
      scale_noise=1,
      act="relu",
      use_act=False,
      first_filter_size=None,
      pool_type=None,
      dropout=None,
      unique_masks=False,
      train_masks=False,
      noise_type="uniform",
      mix_maps=None,
  ):
      super(LeNet, self).__init__()
      if filter_size == 5:
          n = 5
      else:
          n = 4
  
      if input_size == 32:
          first_channels = 3
      elif input_size == 28:
          first_channels = 1
  
      if pool_type == "max":
          pool = nn.MaxPool2d
      elif pool_type == "avg":
          pool = nn.AvgPool2d
      else:
          print(
              "\n\nPool Type {} is not supported/understood\n\n".format(
                  pool_type
              )
          )
          return
  
      self.linear1 = nn.Linear(nfilters * n * n, linear)
      self.linear2 = nn.Linear(linear, nclasses)
      self.dropout = nn.Dropout(p=dropout)
      self.act = act_fn(act)
      self.batch_norm = nn.BatchNorm1d(linear)
  
      self.first_layers = nn.Sequential(
          PerturbLayer(
              in_channels=first_channels,
              out_channels=nfilters,
              nmasks=nmasks,
              level=level * scale_noise,
              filter_size=first_filter_size,
              use_act=use_act,
              act=act,
              unique_masks=unique_masks,
              train_masks=train_masks,
              noise_type=noise_type,
              input_size=input_size,
              mix_maps=mix_maps,
          ),
          pool(kernel_size=3, stride=2, padding=1),
          PerturbLayer(
              in_channels=nfilters,
              out_channels=nfilters,
              nmasks=nmasks,
              level=level,
              filter_size=filter_size,
              use_act=True,
              act=act,
              unique_masks=unique_masks,
              debug=debug,
              train_masks=train_masks,
              noise_type=noise_type,
              input_size=input_size // 2,
              mix_maps=mix_maps,
          ),
          pool(kernel_size=3, stride=2, padding=1),
          PerturbLayer(
              in_channels=nfilters,
              out_channels=nfilters,
              nmasks=nmasks,
              level=level,
              filter_size=filter_size,
              use_act=True,
              act=act,
              unique_masks=unique_masks,
              train_masks=train_masks,
              noise_type=noise_type,
              input_size=input_size // 4,
              mix_maps=mix_maps,
          ),
          pool(kernel_size=3, stride=2, padding=1),
      )
  
      self.last_layers = nn.Sequential(
          self.dropout,
          self.linear1,
          self.batch_norm,
          self.act,
          self.dropout,
          self.linear2,
      )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new LeNet object from inherited base classes: nn with example: obj = LeNet(nfilters, nclasses, nmasks, level, filter_size, linear, input_size, debug, scale_noise, act, use_act, first_filter_size, pool_type, dropout, unique_masks, train_masks, noise_type, mix_maps)