class_docstr: asr keras base solver
class_docstr_tok: ["asr","keras","base","solver"]
code: def __init__(self, config):
      super().__init__(config)
      self.batch_input_shape = None
  
      self._solver = config["solver"]
      self._num_epochs = self._solver["optimizer"]["epochs"]
  
      self._lr = self._solver["optimizer"]["learning_rate"]["rate"]
      self._decay_rate = self._solver["optimizer"]["learning_rate"][
          "decay_rate"
      ]
      self._val_metric = (
          self._solver["optimizer"]["learning_rate"]["type"]
          == "val_metric"
      )
      if self._val_metric:
          self._min_lr = self._solver["optimizer"]["learning_rate"][
              "min_rate"
          ]
          self._patience = self._solver["optimizer"]["learning_rate"][
              "patience"
          ]
  
      self._clipnorm = self._solver["optimizer"]["clip_global_norm"]
      self._early_stopping = self._solver["optimizer"][
          "early_stopping"
      ]["enable"]
  
      self._monitor_used = (
          self._solver["metrics"]["monitor_used"] or "val_loss"
      )
      self._metrics_used = (
          []
          if self._solver["metrics"]["metrics_used"] is None
          else self._solver["metrics"]["metrics_used"]
      )
  
      self._model_path = self._solver["saver"]["model_path"]
      self._model_load_type = self._solver["loader"]["model_load_type"]
      self._init_epoch = self._solver["loader"]["init_epoch"]
      self._specified_model_file = self._solver["loader"]["file_name"]
  
      self._checkpoint_file_pattern = (
          "model.{epoch:02d}-{monitor_used:.2f}.ckpt"
      )
  
      logging.info("num_epochs : {}".format(self._num_epochs))
      logging.info("lr : {}".format(self._lr))
      logging.info("saver path : {}".format(self._model_path))
  
      devices, self._ngpu = utils.gpu_device_names()
      logging.info(f"ngpu: {self._ngpu}, device list: {devices}")
  
      # model
      self._model = None
      self._parallel_model = None
      self._built = False
  
imports: from pathlib import Path
  from absl import logging
  import delta.compat
  from tensorflow.keras.utils import multi_gpu_model
  from tensorflow.keras.callbacks import EarlyStopping
  from tensorflow.keras.callbacks import TensorBoard
  from tensorflow.keras.callbacks import CSVLogger
  from tensorflow.keras.callbacks import ReduceLROnPlateau
  from delta import utils
  from delta.utils.solver.utils import solver_utils
  from delta.utils.solver.base_solver import Solver
  from delta.utils.solver.utils.callbacks import ParallelModelCheckpoint
  from delta.utils.register import registers
label_desc: Use image node_id 1 to create a new KerasBaseSolver object from inherited base classes: Solver with example: obj = KerasBaseSolver(config)