def METHOD_NAME(self):
    if self.loss_fn is None and self.config.loss is not None:
        loss_cls = getattr(losses, self.config.loss.loss_cls)
        self.loss_fn = loss_cls()
    return self.loss_fn