dgs.models.loss.loss.CrossEntropyLoss

class dgs.models.loss.loss.CrossEntropyLoss(*args: Any, **kwargs: Any)[source]

Compute the Cross Entropy Loss after computing the LogSoftmax on the input data.

Methods

__init__(**kwargs)[source]
forward(inputs: torch.Tensor, targets: torch.Tensor) torch.Tensor[source]

Given predictions of shape [B x nof_classes] and targets of shape [B] compute and return the CrossEntropyLoss.