code: def __init__(
      self,
      data: BertLMDataBunch,
      model: torch.nn.Module,
      pretrained_model_path,
      output_dir,
      metrics,
      device,
      logger,
      multi_gpu=True,
      is_fp16=True,
      warmup_steps=0,
      fp16_opt_level="O1",
      grad_accumulation_steps=1,
      max_grad_norm=1.0,
      adam_epsilon=1e-8,
      logging_steps=100,
  ):
      if isinstance(output_dir, str):
          output_dir = Path(output_dir)
  
      self.data = data
      self.model = model
      self.pretrained_model_path = pretrained_model_path
      self.metrics = metrics
      self.multi_gpu = multi_gpu
      self.is_fp16 = is_fp16
      self.fp16_opt_level = fp16_opt_level
      self.adam_epsilon = adam_epsilon
      self.warmup_steps = warmup_steps
      self.grad_accumulation_steps = grad_accumulation_steps
      self.device = device
      self.logger = logger
      self.optimizer = None
      self.n_gpu = 0
      self.max_grad_norm = max_grad_norm
      self.logging_steps = logging_steps
      self.max_steps = -1
      self.weight_decay = 0.0
      self.model_type = data.model_type
  
      self.output_dir = output_dir
  
      self.scaler = (
          torch.cuda.amp.GradScaler() if is_fp16 is True else None
      )
  
      if self.multi_gpu:
          self.n_gpu = torch.cuda.device_count()
  
file_path: fast-bert/fast_bert/learner_lm.py
imports: import os
  import torch
  from packaging import version
  from pathlib import Path
  import numpy
  from fastprogress.fastprogress import master_bar, progress_bar
  from tensorboardX import SummaryWriter
  from .learner_util import Learner
  from .data_lm import BertLMDataBunch
  from transformers import WEIGHTS_NAME, BertConfig, BertForMaskedLM, RobertaConfig, RobertaForMaskedLM, DistilBertConfig, DistilBertForMaskedLM, CamembertConfig, CamembertForMaskedLM, ElectraConfig, ElectraForMaskedLM
  from torch.optim.lr_scheduler import _LRScheduler, Optimizer
label_desc: Use image node_id 2 to create a new BertLMLearner object from inherited base classes: Learner with example: obj = BertLMLearner(data, model, pretrained_model_path, output_dir, metrics, device, logger, multi_gpu, is_fp16, warmup_steps, fp16_opt_level, grad_accumulation_steps, max_grad_norm, adam_epsilon, logging_steps)