class_docstr: Trainer configuration.
  
  Args:
      batch_size (int): Number of samples in each batch of training
  
      data_aware_init_batch_size (int): Number of samples in each batch of training for the data-aware initialization,
          when applicable. Defaults to 2000
  
      fast_dev_run (bool): runs n if set to ``n`` (int) else 1 if set to ``True`` batch(es) of train, val
              and test to find any bugs (ie: a sort of unit test).
  
      max_epochs (int): Maximum number of epochs to be run
  
      min_epochs (Optional[int]): Force training for at least these many epochs. 1 by default
  
      max_time (Optional[int]): Stop training after this amount of time has passed. Disabled by default
              (None)
  
      accelerator (Optional[str]): The accelerator to use for training. Can be one of
              'cpu','gpu','tpu','ipu', 'mps', 'auto'. Defaults to 'auto'.
              Choices are: [`cpu`,`gpu`,`tpu`,`ipu`,'mps',`auto`].
  
      devices (Optional[int]): Number of devices to train on (int). -1 uses all available devices. By
              default, uses all available devices (-1)
  
      devices_list (Optional[List[int]]): List of devices to train on (list). If specified, takes
              precedence over `devices` argument. Defaults to None
  
      accumulate_grad_batches (int): Accumulates grads every k batches or as set up in the dict. Trainer
              also calls optimizer.step() for the last indivisible step number.
  
      auto_lr_find (bool): Runs a learning rate finder algorithm when calling
              trainer.tune(), to find optimal initial learning rate.
  
      auto_select_gpus (bool): If enabled and `devices` is an integer, pick available gpus automatically.
              This is especially useful when GPUs are configured to be in 'exclusive mode', such that only one
              process at a time can access them.
  
      check_val_every_n_epoch (int): Check val every n train epochs.
  
      gradient_clip_val (float): Gradient clipping value
  
      overfit_batches (float): Uses this much data of the training set. If nonzero, will use the same
              training set for validation and testing. If the training dataloaders have shuffle=True, Lightning
              will automatically disable it. Useful for quickly debugging or trying to overfit on purpose.
  
      deterministic (bool): If true enables cudnn.deterministic. Might make your system slower, but
              ensures reproducibility.
  
      profiler (Optional[str]): To profile individual steps during training and assist in identifying
              bottlenecks. None, simple or advanced, pytorch. Choices are:
              [`None`,`simple`,`advanced`,`pytorch`].
  
      early_stopping (Optional[str]): The loss/metric that needed to be monitored for early stopping. If
              None, there will be no early stopping
  
      early_stopping_min_delta (float): The minimum delta in the loss/metric which qualifies as an
              improvement in early stopping
  
      early_stopping_mode (str): The direction in which the loss/metric should be optimized. Choices are:
              [`max`,`min`].
  
      early_stopping_patience (int): The number of epochs to wait until there is no further improvements
              in loss/metric
  
      early_stopping_kwargs (Optional[Dict]): Additional keyword arguments for the early stopping callback.
              See the documentation for the PyTorch Lightning EarlyStopping callback for more details.
  
      checkpoints (Optional[str]): The loss/metric that needed to be monitored for checkpoints. If None,
              there will be no checkpoints
  
      checkpoints_path (str): The path where the saved models will be
  
      checkpoints_every_n_epochs (int): Number of training steps between checkpoints
  
      checkpoints_name (Optional[str]): The name under which the models will be saved. If left blank,
              first it will look for `run_name` in experiment_config and if that is also None then it will use a
              generic name like task_version.
  
      checkpoints_mode (str): The direction in which the loss/metric should be optimized
  
      checkpoints_save_top_k (int): The number of best models to save
  
      checkpoints_kwargs (Optional[Dict]): Additional keyword arguments for the checkpoints callback.
              See the documentation for the PyTorch Lightning ModelCheckpoint callback for more details.
  
      load_best (bool): Flag to load the best model saved during training
  
      track_grad_norm (int): Track and Log Gradient Norms in the logger. -1 by default means no tracking.
              1 for the L1 norm, 2 for L2 norm, etc.
  
      progress_bar (str): Progress bar type. Can be one of: `none`, `simple`, `rich`. Defaults to `rich`.
  
      precision (int): Precision of the model. Can be one of: `32`, `16`, `64`. Defaults to `32`..
              Choices are: [`32`,`16`,`64`].
  
      seed (int): Seed for random number generators. Defaults to 42
  
      trainer_kwargs (Dict[str, Any]): Additional kwargs to be passed to PyTorch Lightning Trainer. See
              https://pytorch-lightning.readthedocs.io/en/latest/api/pytorch_lightning.trainer.html#pytorch_lightning.trainer.Trainer
class_docstr_tok: ["Trainer","configuration",".","Args",":","batch_size","(","int",")",":","Number","of","samples","in","each","batch","of","training","data_aware_init_batch_size","(","int",")",":","Number","of","samples","in","each","batch","of","training","for","the","data-aware","initialization",",","when","applicable",".","Defaults","to","2000","fast_dev_run","(","bool",")",":","runs","n","if","set","to","``","n","``","(","int",")","else","1","if","set","to","``","True","``","batch","(","es",")","of","train",",","val","and","test","to","find","any","bugs","(","ie",":","a","sort","of","unit","test",")",".","max_epochs","(","int",")",":","Maximum","number","of","epochs","to","be","run","min_epochs","(","Optional","[","int","]",")",":","Force","training","for","at","least","these","many","epochs",".","1","by","default","max_time","(","Optional","[","int","]",")",":","Stop","training","after","this","amount","of","time","has","passed",".","Disabled","by","default","(","None",")","accelerator","(","Optional","[","str","]",")",":","The","accelerator","to","use","for","training",".","Can","be","one","of","'cpu","'",",","'gpu","'",",","'tpu","'",",","'ipu","'",",","'mps","'",",","'auto","'",".","Defaults","to","'auto","'",".","Choices","are",":","[","`","cpu","`",",","`","gpu","`",",","`","tpu","`",",","`","ipu","`",",","'mps","'",",","`","auto","`","]",".","devices","(","Optional","[","int","]",")",":","Number","of","devices","to","train","on","(","int",")",".","-1","uses","all","available","devices",".","By","default",",","uses","all","available","devices","(","-1",")","devices_list","(","Optional","[","List","[","int","]","]",")",":","List","of","devices","to","train","on","(","list",")",".","If","specified",",","takes","precedence","over","`","devices","`","argument",".","Defaults","to","None","accumulate_grad_batches","(","int",")",":","Accumulates","grads","every","k","batches","or","as","set","up","in","the","dict",".","Trainer","also","calls","optimizer.step","(",")","for","the","last","indivisible","step","number",".","auto_lr_find","(","bool",")",":","Runs","a","learning","rate","finder","algorithm","when","calling","trainer.tune","(",")",",","to","find","optimal","initial","learning","rate",".","auto_select_gpus","(","bool",")",":","If","enabled","and","`","devices","`","is","an","integer",",","pick","available","gpus","automatically",".","This","is","especially","useful","when","GPUs","are","configured","to","be","in","'exclusive","mode","'",",","such","that","only","one","process","at","a","time","can","access","them",".","check_val_every_n_epoch","(","int",")",":","Check","val","every","n","train","epochs",".","gradient_clip_val","(","float",")",":","Gradient","clipping","value","overfit_batches","(","float",")",":","Uses","this","much","data","of","the","training","set",".","If","nonzero",",","will","use","the","same","training","set","for","validation","and","testing",".","If","the","training","dataloaders","have","shuffle=True",",","Lightning","will","automatically","disable","it",".","Useful","for","quickly","debugging","or","trying","to","overfit","on","purpose",".","deterministic","(","bool",")",":","If","true","enables","cudnn.deterministic",".","Might","make","your","system","slower",",","but","ensures","reproducibility",".","profiler","(","Optional","[","str","]",")",":","To","profile","individual","steps","during","training","and","assist","in","identifying","bottlenecks",".","None",",","simple","or","advanced",",","pytorch",".","Choices","are",":","[","`","None","`",",","`","simple","`",",","`","advanced","`",",","`","pytorch","`","]",".","early_stopping","(","Optional","[","str","]",")",":","The","loss\/metric","that","needed","to","be","monitored","for","early","stopping",".","If","None",",","there","will","be","no","early","stopping","early_stopping_min_delta","(","float",")",":","The","minimum","delta","in","the","loss\/metric","which","qualifies","as","an","improvement","in","early","stopping","early_stopping_mode","(","str",")",":","The","direction","in","which","the","loss\/metric","should","be","optimized",".","Choices","are",":","[","`","max","`",",","`","min","`","]",".","early_stopping_patience","(","int",")",":","The","number","of","epochs","to","wait","until","there","is","no","further","improvements","in","loss\/metric","early_stopping_kwargs","(","Optional","[","Dict","]",")",":","Additional","keyword","arguments","for","the","early","stopping","callback",".","See","the","documentation","for","the","PyTorch","Lightning","EarlyStopping","callback","for","more","details",".","checkpoints","(","Optional","[","str","]",")",":","The","loss\/metric","that","needed","to","be","monitored","for","checkpoints",".","If","None",",","there","will","be","no","checkpoints","checkpoints_path","(","str",")",":","The","path","where","the","saved","models","will","be","checkpoints_every_n_epochs","(","int",")",":","Number","of","training","steps","between","checkpoints","checkpoints_name","(","Optional","[","str","]",")",":","The","name","under","which","the","models","will","be","saved",".","If","left","blank",",","first","it","will","look","for","`","run_name","`","in","experiment_config","and","if","that","is","also","None","then","it","will","use","a","generic","name","like","task_version",".","checkpoints_mode","(","str",")",":","The","direction","in","which","the","loss\/metric","should","be","optimized","checkpoints_save_top_k","(","int",")",":","The","number","of","best","models","to","save","checkpoints_kwargs","(","Optional","[","Dict","]",")",":","Additional","keyword","arguments","for","the","checkpoints","callback",".","See","the","documentation","for","the","PyTorch","Lightning","ModelCheckpoint","callback","for","more","details",".","load_best","(","bool",")",":","Flag","to","load","the","best","model","saved","during","training","track_grad_norm","(","int",")",":","Track","and","Log","Gradient","Norms","in","the","logger",".","-1","by","default","means","no","tracking",".","1","for","the","L1","norm",",","2","for","L2","norm",",","etc",".","progress_bar","(","str",")",":","Progress","bar","type",".","Can","be","one","of",":","`","none","`",",","`","simple","`",",","`","rich","`",".","Defaults","to","`","rich","`",".","precision","(","int",")",":","Precision","of","the","model",".","Can","be","one","of",":","`","32","`",",","`","16","`",",","`","64","`",".","Defaults","to","`","32","`","..","Choices","are",":","[","`","32","`",",","`","16","`",",","`","64","`","]",".","seed","(","int",")",":","Seed","for","random","number","generators",".","Defaults","to","42","trainer_kwargs","(","Dict","[","str",",","Any","]",")",":","Additional","kwargs","to","be","passed","to","PyTorch","Lightning","Trainer",".","See","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/latest\/api\/pytorch_lightning.trainer.html","#","pytorch_lightning.trainer.Trainer"]
code: def __post_init__(self):
      _validate_choices(self)
      if self.accelerator is None:
          self.accelerator = "cpu"
      if self.devices_list is not None:
          self.devices = self.devices_list
      delattr(self, "devices_list")
      for key in self.early_stopping_kwargs.keys():
          if key in ["min_delta", "mode", "patience"]:
              raise ValueError(
                  f"Cannot override {key} in early_stopping_kwargs."
                  f" Please use the appropriate argument in `TrainerConfig`"
              )
      for key in self.checkpoints_kwargs.keys():
          if key in [
              "dirpath",
              "filename",
              "monitor",
              "save_top_k",
              "mode",
              "every_n_epochs",
          ]:
              raise ValueError(
                  f"Cannot override {key} in checkpoints_kwargs."
                  f" Please use the appropriate argument in `TrainerConfig`"
              )
  
imports: import os
  import re
  from dataclasses import MISSING, dataclass, field
  from typing import Any, Dict, Iterable, List, Optional
  from omegaconf import OmegaConf
  from pytorch_tabular.models.common import heads
  from pytorch_tabular.utils import get_logger
label_desc: Use image node_id 1 for calling the TrainerConfig obj's underlying member method code with example usage: obj.__post_init__() without return types