class_docstr: Create a Unet-based generator
class_docstr_tok: ["Create","a","Unet-based","generator"]
docstr: Construct a Unet generator
  Parameters:
      opt - options for the network generation
      model_type - type of the model to be generated
      num_class - output of the network
      modules_lib - all modules that can be used in the UNet
  We construct the U-Net from the innermost layer to the outermost layer.
  It is a recursive process.
  
  opt is expected to contains the following keys:
  * down_conv
  * up_conv
  * OPTIONAL: innermost
code: def __init__(
      self, opt, model_type, dataset: BaseDataset, modules_lib
  ):
      """Construct a Unet generator
      Parameters:
          opt - options for the network generation
          model_type - type of the model to be generated
          num_class - output of the network
          modules_lib - all modules that can be used in the UNet
      We construct the U-Net from the innermost layer to the outermost layer.
      It is a recursive process.
  
      opt is expected to contains the following keys:
      * down_conv
      * up_conv
      * OPTIONAL: innermost
      """
      opt = copy.deepcopy(opt)
      super(UnetBasedModel, self).__init__(opt)
      self._spatial_ops_dict = {
          "neighbour_finder": [],
          "sampler": [],
          "upsample_op": [],
      }
      # detect which options format has been used to define the model
      if (
          type(opt.down_conv) is ListConfig
          or "down_conv_nn" not in opt.down_conv
      ):
          self._init_from_layer_list_format(
              opt, model_type, dataset, modules_lib
          )
      else:
          self._init_from_compact_format(
              opt, model_type, dataset, modules_lib
          )
  
imports: from torch import nn
  from torch_geometric.nn import global_max_pool, global_mean_pool, fps, radius, knn_interpolate
  from torch.nn import Linear, ReLU, LeakyReLU, BatchNorm1d, Dropout
  from omegaconf.listconfig import ListConfig
  from omegaconf.dictconfig import DictConfig
  import logging
  import copy
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.core.common_modules.base_modules import Identity
  from torch_points3d.utils.config import is_list
label_desc: Use image node_id 2 to create a new UnetBasedModel object from inherited base classes: BaseModel with example: obj = UnetBasedModel(opt, model_type, dataset, modules_lib)