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\}\).

Initializes internal Module state, shared by both nn.Module and ScriptModule.

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