docstr: Called after fit_batch(), updates learning rate and does per-step logging. 
docstr_tok: ["Called","after","fit_batch","(",")",",","updates","learning","rate","and","does","per-step","logging","."]
code: def on_fit_batch_end(self, objectives):
      """Called after fit_batch(), updates learning rate and does per-step logging."""
      if isinstance(
          self.modules.target_quantiser, DistributedDataParallel
      ):
          w2v_model = self.modules.target_quantiser.module
      else:
          w2v_model = self.modules.target_quantiser
  
      w2v_model.quantiser.update_temp(self.optimizer_step)
  
      self.hparams.lr_scheduler(self.optimizer, self.optimizer_step)
  
      # Perform step-wise logging
      if (
          hasattr(self.hparams, "log_interval")
          and self.optimizer_step % self.hparams.log_interval == 0
      ):
          # Create a dictionary and fill it with everything we
          # want to log such as contrastive loss, diversity loss,
          # learning rate etc.
          log_dct = {
              k: (v.item() if isinstance(v, torch.Tensor) else v)
              for k, v in objectives.items()
          }
          current_lr = self.optimizer.param_groups[0]["lr"]
          log_dct["steps"] = self.optimizer_step
          log_dct["lr"] = current_lr
          log_dct["avg_loss"] = self.avg_train_loss
  
          if hasattr(self, "time_last_log"):
              run_time_since_last_log = time.time() - self.time_last_log
              log_dct["run_time"] = run_time_since_last_log
          self.time_last_log = time.time()
  
          if sb.utils.distributed.if_main_process():
              self.hparams.train_steps_logger.log_stats(
                  stats_meta=log_dct,
              )
  
imports: import logging
  import sys
  import time
  from functools import partial
  import speechbrain
  import torch
  import torch.nn.functional
  from torch.nn.parallel import DistributedDataParallel
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain import Stage
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.dataio.dataloader import SaveableDataLoader
  from speechbrain.dataio.sampler import DynamicBatchSampler
  from speechbrain.lobes.models.wav2vec import w2v_mask_collate_fn
  from speechbrain.lobes.models.wav2vec import sample_negatives
  from speechbrain.core import AMPConfig
label_desc: Use image node_id 4 for calling the W2V2Brain obj's underlying member method code with example usage: obj.on_fit_batch_end(objectives) without return types