code: def plot_top_losses(
      x: TensorImage,
      y: TensorMultiCategory,
      samples,
      outs,
      raws,
      losses,
      nrows=None,
      ncols=None,
      figsize=None,
      **kwargs,
  ):
      axs = get_grid(
          len(samples), nrows=nrows, ncols=ncols, figsize=figsize
      )
      for i, (ax, s) in enumerate(zip(axs, samples)):
          s[0].show(ctx=ax, title=f"Image {i}", **kwargs)
      rows = get_empty_df(len(samples))
      outs = L(
          s[1:] + o + (TitledStr(r), TitledFloat(l.item()))
          for s, o, r, l in zip(samples, outs, raws, losses)
      )
      for i, l in enumerate(
          ["target", "predicted", "probabilities", "loss"]
      ):
          rows = [
              b.show(ctx=r, label=l, **kwargs)
              for b, r in zip(outs.itemgot(i), rows)
          ]
      display_df(pd.DataFrame(rows))
  
imports: from __future__ import annotations
  from packaging.version import parse
  from ..basics import *
  from .core import *
  from .data import *
  from .augment import *
  from .None import models
  import torchvision
  from ..callback.hook import num_features_model
label_desc: Use image node_id 31 for calling a global function with example usage: plot_top_losses(x, y, samples, outs, raws, losses, nrows, ncols, figsize) without return types