class_docstr: Saves model topology, losses & metrics
class_docstr_tok: ["Saves","model","topology",",","losses","&","metrics"]
docstr: Log hyper-parameters and training loss
docstr_tok: ["Log","hyper-parameters","and","training","loss"]
code: def after_batch(self):
      "Log hyper-parameters and training loss"
      if self.training:
          batch_time = time.perf_counter() - self.ti_batch
          self._wandb_step += 1
          self._wandb_epoch += 1 / self.n_iter
          hypers = {
              f"{k}_{i}": v
              for i, h in enumerate(self.opt.hypers)
              for k, v in h.items()
          }
          wandb.log(
              {
                  "epoch": self._wandb_epoch,
                  "train_loss": self.smooth_loss,
                  "raw_loss": self.loss,
                  **hypers,
              },
              step=self._wandb_step,
          )
          wandb.log(
              {"train_samples_per_sec": len(self.xb[0]) / batch_time},
              step=self._wandb_step,
          )
  
imports: from __future__ import annotations
  from ..basics import *
  from .progress import *
  from ..text.data import TensorText
  from ..tabular.all import TabularDataLoaders, Tabular
  from .hook import total_params
  from .tracker import SaveModelCallback
  import wandb
label_desc: Use image node_id 5 for calling the WandbCallback obj's underlying member method code with example usage: obj.after_batch() without return types