class SoftplusLoss(reduction='mean')[source]

Bases: SoftPointwiseHingeLoss

The pointwise logistic loss (i.e., softplus loss).

\[g(s, l) = \log(1 + \exp(-\hat{l} \cdot s))\]

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

See also

This class is a special case of pykeen.losses.SoftPointwiseHingeLoss where the margin is set to margin=0.

Initialize the loss.


reduction (str) – the reduction, cf. SoftPointwiseHingeLoss.__init__()

Attributes Summary


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

Attributes Documentation

hpo_default: ClassVar[Mapping[str, Any]] = {}

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