code: def plot_losses(pipeline_result, *, ax=None):
      """Plot the losses per epoch."""
      import seaborn as sns
  
      sns.set_style("darkgrid")
  
      ax = _ensure_ax(ax)
      rv = sns.lineplot(
          x=range(len(pipeline_result.losses)),
          y=pipeline_result.losses,
          ax=ax,
      )
  
      loss_name = loss_resolver.normalize_inst(
          pipeline_result.model.loss
      )
      ax.set_ylabel(f"{loss_name} Loss")
      ax.set_xlabel("Epoch")
      ax.set_title(
          pipeline_result.title
          if pipeline_result.title is not None
          else "Losses Plot"
      )
      return rv
  
file_path: pykeen/src/pykeen/pipeline/plot_utils.py
imports: import logging
  from typing import Callable, Mapping, Optional, Set
  from ..losses import loss_resolver
  from ..models.nbase import ERModel
  from ..nn.representation import Representation
  from ..stoppers import EarlyStopper
label_desc: Use image node_id 1 for calling a global function with example usage: plot_losses(pipeline_result) and returns: rv