SoftplusLoss

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

Bases: pykeen.losses.PointwiseLoss

A module for the softplus loss.

\[L(score, label) = softplus(- label \cdot score)\]

with \(label \in \{-1, 1\}\).

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

Methods Summary

forward(logits, labels)

Calculate the loss for the given scores and labels.

Methods Documentation

forward(logits, labels)[source]

Calculate the loss for the given scores and labels.

Return type

FloatTensor