code: def __init__(
      self,
      height: int,
      width: int,
      resnet_size: int = 50,
      num_channels: int = 3,
      out_channels: int = 16,
      kernel_size: Union[int, Tuple[int]] = 3,
      conv_stride: Union[int, Tuple[int]] = 1,
      first_pool_kernel_size: Union[int, Tuple[int]] = None,
      first_pool_stride: Union[int, Tuple[int]] = None,
      batch_norm_momentum: float = 0.1,
      batch_norm_epsilon: float = 0.001,
      fc_layers: Optional[List[Dict]] = None,
      num_fc_layers: Optional[int] = 1,
      output_size: int = 256,
      use_bias: bool = True,
      weights_initializer: str = "xavier_uniform",
      bias_initializer: str = "zeros",
      norm: Optional[str] = None,
      norm_params: Optional[Dict[str, Any]] = None,
      activation: str = "relu",
      dropout: float = 0,
      encoder_config=None,
      **kwargs,
  ):
      super().__init__()
      self.config = encoder_config
  
      logger.debug(f" {self.name}")
      # map parameter input feature config names to internal names
      img_height = height
      img_width = width
      first_in_channels = num_channels
  
      self._input_shape = (first_in_channels, img_height, img_width)
  
      logger.debug("  ResNet")
      self.resnet = ResNet(
          img_height=img_height,
          img_width=img_width,
          first_in_channels=first_in_channels,
          out_channels=out_channels,
          resnet_size=resnet_size,
          kernel_size=kernel_size,
          conv_stride=conv_stride,
          first_pool_kernel_size=first_pool_kernel_size,
          first_pool_stride=first_pool_stride,
          batch_norm_momentum=batch_norm_momentum,
          batch_norm_epsilon=batch_norm_epsilon,
      )
      first_fc_layer_input_size = self.resnet.output_shape[0]
  
      logger.debug("  FCStack")
      self.fc_stack = FCStack(
          first_layer_input_size=first_fc_layer_input_size,
          layers=fc_layers,
          num_layers=num_fc_layers,
          default_output_size=output_size,
          default_use_bias=use_bias,
          default_weights_initializer=weights_initializer,
          default_bias_initializer=bias_initializer,
          default_norm=norm,
          default_norm_params=norm_params,
          default_activation=activation,
          default_dropout=dropout,
      )
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple, Type, Union
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import ENCODER_OUTPUT, IMAGE
  from ludwig.encoders.base import Encoder
  from ludwig.encoders.registry import register_encoder
  from ludwig.encoders.types import EncoderOutputDict
  from ludwig.modules.convolutional_modules import Conv2DStack, ResNet
  from ludwig.modules.fully_connected_modules import FCStack
  from ludwig.modules.mlp_mixer_modules import MLPMixer
  from ludwig.schema.encoders.image.base import ImageEncoderConfig, MLPMixerConfig, ResNetConfig, Stacked2DCNNConfig, ViTConfig
  from ludwig.utils.torch_utils import FreezeModule
label_desc: Use image node_id 1 to create a new ResNetEncoder object from inherited base classes: ImageEncoder with example: obj = ResNetEncoder(height, width, resnet_size, num_channels, out_channels, kernel_size, conv_stride, first_pool_kernel_size, first_pool_stride, batch_norm_momentum, batch_norm_epsilon, fc_layers, num_fc_layers, output_size, use_bias, weights_initializer, bias_initializer, norm, norm_params, activation, dropout, encoder_config)