class_docstr: Base class for different image classification models
class_docstr_tok: ["Base","class","for","different","image","classification","models"]
code: def __init__(self, opts: argparse.Namespace, *args, **kwargs) -> None:
      super().__init__(opts, *args, **kwargs)
      self.conv_1 = None
      self.layer_1 = None
      self.layer_2 = None
      self.layer_3 = None
      self.layer_4 = None
      self.layer_5 = None
      self.conv_1x1_exp = None
      self.classifier = None
      self.round_nearest = 8
  
      # Segmentation architectures like Deeplab and PSPNet modifies the strides of the backbone
      # We allow that using output_stride and replace_stride_with_dilation arguments
      self.dilation = 1
      output_stride = kwargs.get("output_stride", None)
      self.dilate_l4 = False
      self.dilate_l5 = False
      if output_stride == 8:
          self.dilate_l4 = True
          self.dilate_l5 = True
      elif output_stride == 16:
          self.dilate_l5 = True
      self.output_stride = output_stride
  
      self.model_conf_dict = dict()
      self.neural_augmentor = build_neural_augmentor(
          opts=opts, *args, **kwargs
      )
      self.gradient_checkpointing = getattr(
          opts, "model.classification.gradient_checkpointing", False
      )
      self.enable_layer_wise_lr_decay = getattr(
          opts, "model.classification.enable_layer_wise_lr_decay"
      )
      self.layer_wise_lr_decay_rate = getattr(
          opts, "model.classification.layer_wise_lr_decay_rate"
      )
  
imports: import argparse
  from typing import Any, Dict, List, Mapping, Optional, Tuple
  import torch
  from torch import Tensor, nn
  from torch.utils.checkpoint import checkpoint
  from common import is_test_env
  from cvnets.layers import LinearLayer
  from cvnets.misc.init_utils import initialize_fc_layer
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from cvnets.neural_augmentor import build_neural_augmentor
  from utils import logger
label_desc: Use image node_id 1 to create a new BaseImageEncoder object from inherited base classes: BaseAnyNNModel with example: obj = BaseImageEncoder(opts)