PointwiseHingeLoss

class PointwiseHingeLoss(margin=1.0, reduction='mean')[source]

Bases: pykeen.losses.DeltaPointwiseLoss

A module for the pointwise hinge loss.

\[g(s,l) = \max(0, \lambda -\hat{l}*s)\]

with scores \(s\) and labels \(l\) that have been rescaled to \(\hat{l} \in \{-1, 1\}\).

Initialize the loss.

Parameters
  • margin (float) – the margin, cf. DeltaPointwiseLoss.__init__()

  • reduction (str) – the reduction, cf. DeltaPointwiseLoss.__init__()

Attributes Summary

hpo_default

The default strategy for optimizing the loss's hyper-parameters

Attributes Documentation

hpo_default: ClassVar[Mapping[str, Any]] = {'margin': {'high': 3, 'low': 0, 'type': <class 'float'>}}

The default strategy for optimizing the loss’s hyper-parameters