class_docstr: A delayed implementation based on TrainerRM, which means `train` method may only do some preparation and `end_train` method can do the real model fitting.
class_docstr_tok: ["A","delayed","implementation","based","on","TrainerRM",",","which","means","`","train","`","method","may","only","do","some","preparation","and","`","end_train","`","method","can","do","the","real","model","fitting","."]
docstr: Init DelayTrainerRM.
  
  Args:
      experiment_name (str): the default name of experiment.
      task_pool (str): task pool name in TaskManager. None for use same name as experiment_name.
      train_func (Callable, optional): default train method. Defaults to `begin_task_train`.
      end_train_func (Callable, optional): default end_train method. Defaults to `end_task_train`.
      skip_run_task (bool):
          If skip_run_task == True:
          Only run_task in the worker. Otherwise skip run_task.
          E.g. Starting trainer on a CPU VM and then waiting tasks to be finished on GPU VMs.
docstr_tok: ["Init","DelayTrainerRM",".","Args",":","experiment_name","(","str",")",":","the","default","name","of","experiment",".","task_pool","(","str",")",":","task","pool","name","in","TaskManager",".","None","for","use","same","name","as","experiment_name",".","train_func","(","Callable",",","optional",")",":","default","train","method",".","Defaults","to","`","begin_task_train","`",".","end_train_func","(","Callable",",","optional",")",":","default","end_train","method",".","Defaults","to","`","end_task_train","`",".","skip_run_task","(","bool",")",":","If","skip_run_task","==","True",":","Only","run_task","in","the","worker",".","Otherwise","skip","run_task",".","E.g",".","Starting","trainer","on","a","CPU","VM","and","then","waiting","tasks","to","be","finished","on","GPU","VMs","."]
code: def __init__(
      self,
      experiment_name: str = None,
      task_pool: str = None,
      train_func=begin_task_train,
      end_train_func=end_task_train,
      skip_run_task: bool = False,
      **kwargs,
  ):
      """
      Init DelayTrainerRM.
  
      Args:
          experiment_name (str): the default name of experiment.
          task_pool (str): task pool name in TaskManager. None for use same name as experiment_name.
          train_func (Callable, optional): default train method. Defaults to `begin_task_train`.
          end_train_func (Callable, optional): default end_train method. Defaults to `end_task_train`.
          skip_run_task (bool):
              If skip_run_task == True:
              Only run_task in the worker. Otherwise skip run_task.
              E.g. Starting trainer on a CPU VM and then waiting tasks to be finished on GPU VMs.
      """
      super().__init__(experiment_name, task_pool, train_func, **kwargs)
      self.end_train_func = end_train_func
      self.delay = True
      self.skip_run_task = skip_run_task
  
imports: import socket
  from typing import Callable, List, Optional
  from tqdm.auto import tqdm
  from qlib.config import C
  from qlib.data.dataset import Dataset
  from qlib.data.dataset.weight import Reweighter
  from qlib.log import get_module_logger
  from qlib.model.base import Model
  from qlib.utils import auto_filter_kwargs, fill_placeholder, flatten_dict, init_instance_by_config
  from qlib.utils.paral import call_in_subproc
  from qlib.workflow import R
  from qlib.workflow.recorder import Recorder
  from qlib.workflow.task.manage import TaskManager, run_task
label_desc: Use image node_id 1 to create a new DelayTrainerRM object from inherited base classes: TrainerRM with example: obj = DelayTrainerRM(experiment_name, task_pool, train_func, end_train_func, skip_run_task)