class_docstr: This class is an abstract base class (ABC) for models.
  To create a subclass, you need to implement the following five functions:
      -- <__init__>:                      initialize the class; first call BaseModel.__init__(self, opt).
      -- <set_input>:                     unpack data from dataset and apply preprocessing.
      -- <forward>:                       produce intermediate results.
      -- <optimize_parameters>:           calculate losses, gradients, and update network weights.
class_docstr_tok: ["This","class","is","an","abstract","base","class","(","ABC",")","for","models",".","To","create","a","subclass",",","you","need","to","implement","the","following","five","functions",":","--","<","__init__",">",":","initialize","the","class",";","first","call","BaseModel.__init__","(","self",",","opt",")",".","--","<","set_input",">",":","unpack","data","from","dataset","and","apply","preprocessing",".","--","<","forward",">",":","produce","intermediate","results",".","--","<","optimize_parameters",">",":","calculate","losses",",","gradients",",","and","update","network","weights","."]
docstr: Initialize the BaseModel class.
  Parameters:
      opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
  When creating your custom class, you need to implement your own initialization.
  In this fucntion, you should first call <BaseModel.__init__(self, opt)>
  Then, you need to define four lists:
      -- self.loss_names (str list):          specify the training losses that you want to plot and save.
      -- self.model_names (str list):         specify the images that you want to display and save.
      -- self.visual_names (str list):        define networks used in our training.
      -- self.optimizers (optimizer list):    define and initialize optimizers. You can define one optimizer for each network. If two networks are updated at the same time, you can use itertools.chain to group them. See cycle_gan_model.py for an example.
docstr_tok: ["Initialize","the","BaseModel","class",".","Parameters",":","opt","(","Option","class",")","--","stores","all","the","experiment","flags",";","needs","to","be","a","subclass","of","BaseOptions","When","creating","your","custom","class",",","you","need","to","implement","your","own","initialization",".","In","this","fucntion",",","you","should","first","call","<","BaseModel.__init__","(","self",",","opt",")",">","Then",",","you","need","to","define","four","lists",":","--","self.loss_names","(","str","list",")",":","specify","the","training","losses","that","you","want","to","plot","and","save",".","--","self.model_names","(","str","list",")",":","specify","the","images","that","you","want","to","display","and","save",".","--","self.visual_names","(","str","list",")",":","define","networks","used","in","our","training",".","--","self.optimizers","(","optimizer","list",")",":","define","and","initialize","optimizers",".","You","can","define","one","optimizer","for","each","network",".","If","two","networks","are","updated","at","the","same","time",",","you","can","use","itertools.chain","to","group","them",".","See","cycle_gan_model.py","for","an","example","."]
code: def __init__(self, opt):
      """Initialize the BaseModel class.
      Parameters:
          opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
      When creating your custom class, you need to implement your own initialization.
      In this fucntion, you should first call <BaseModel.__init__(self, opt)>
      Then, you need to define four lists:
          -- self.loss_names (str list):          specify the training losses that you want to plot and save.
          -- self.model_names (str list):         specify the images that you want to display and save.
          -- self.visual_names (str list):        define networks used in our training.
          -- self.optimizers (optimizer list):    define and initialize optimizers. You can define one optimizer for each network. If two networks are updated at the same time, you can use itertools.chain to group them. See cycle_gan_model.py for an example.
      """
      super(BaseModel, self).__init__()
      self.opt = opt
      self.loss_names = []
      self.visual_names = []
      self.output = None
      self._conv_type = (
          opt.conv_type if hasattr(opt, "conv_type") else None
      )  # Update to OmegaConv 2.0
      self._optimizer: Optional[Optimizer] = None
      self._lr_scheduler: Optimizer[_LRScheduler] = None
      self._bn_scheduler = None
      self._spatial_ops_dict: Dict = {}
      self._num_epochs = 0
      self._num_batches = 0
      self._num_samples = -1
      self._schedulers = {}
      self._accumulated_gradient_step = None
      self._grad_clip = -1
      self._grad_scale = None
      self._supports_mixed = False
      self._enable_mixed = False
      self._update_lr_scheduler_on = "on_epoch"
      self._update_bn_scheduler_on = "on_epoch"
  
imports: from collections import OrderedDict
  from abc import abstractmethod
  from typing import Optional, Dict, Any, List
  import os
  import torch
  from torch.optim.optimizer import Optimizer
  from torch.optim.lr_scheduler import _LRScheduler
  import logging
  from collections import defaultdict
  from torch_points3d.core.schedulers.lr_schedulers import instantiate_scheduler
  from torch_points3d.core.schedulers.bn_schedulers import instantiate_bn_scheduler
  from torch_points3d.utils.enums import SchedulerUpdateOn
  from torch_points3d.core.regularizer import *
  from torch_points3d.core.losses import instantiate_loss_or_miner
  from torch_points3d.utils.config import is_dict
  from torch_points3d.utils.colors import colored_print, COLORS
  from .model_interface import TrackerInterface, DatasetInterface, CheckpointInterface
label_desc: Use image node_id 1 to create a new BaseModel object from inherited base classes: torch.nn, TrackerInterface, DatasetInterface, CheckpointInterface with example: obj = BaseModel(opt)