code: def __init__(
      self,
      input_dim,
      output_dim,
      num_init_point,
      num_sub_point,
      num_neighbor,
      pooler_mode="mean",
  ):
      super(GeoRegionSampler, self).__init__()
      self.input_dim = input_dim
      self.output_dim = output_dim
      self.num_init_point = num_init_point
      self.num_sub_point = num_sub_point
      self.num_neighbor = num_neighbor
  
      self.diff_projector_list = nn.ModuleList()
      self.agg_projector_list = nn.ModuleList()
      self.pooler_list = nn.ModuleList()
  
      for ii in range(len(num_sub_point)):
          self.diff_projector_list.append(
              nn.Linear(self.input_dim + 2, self.input_dim + 2)
          )
          self.agg_projector_list.append(
              ConvReLULN1D(
                  in_channels=2 * (self.input_dim + 2),
                  out_channels=self.input_dim,
              )
          )
          if pooler_mode == "mean":
              self.pooler_list.append(
                  nn.AvgPool1d(kernel_size=num_neighbor[ii])
              )
          elif pooler_mode == "max":
              self.pooler_list.append(
                  nn.AdaptiveMaxPool1d(output_size=1)
              )
          else:
              raise NotImplementedError(
                  f"{self.pooler_mode} is not supported."
              )
  
      self.flatten_projector = nn.Linear(
          self.input_dim * num_sub_point[-1], self.input_dim
      )
      self.dim_projector = nn.Linear(self.input_dim, self.output_dim)
  
      self.norm_init_weights()
  
imports: from abc import ABC, abstractmethod
  import torch
  import torch.nn
  import torch.nn.functional
  import math
  from .multimodal_encoder.builder import build_vision_tower
  import pdb
  from ferret.constants import IGNORE_INDEX, IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_PATCH_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
label_desc: Use image node_id 1 to create a new GeoRegionSampler object from inherited base classes: nn with example: obj = GeoRegionSampler(input_dim, output_dim, num_init_point, num_sub_point, num_neighbor, pooler_mode)