open3d.ml.torch.modules.losses.CrossEntropyLoss#

class open3d.ml.torch.modules.losses.CrossEntropyLoss(loss_weight=1.0)#

CrossEntropyLoss.

__init__(loss_weight=1.0)#

CrossEntropyLoss.

Parameters:

loss_weight (float, optional) – Weight of the loss. Defaults to 1.0.

forward(cls_score, label, weight=None, avg_factor=None, **kwargs)#

Forward function.

Parameters:
  • cls_score (torch.Tensor) – The prediction.

  • label (torch.Tensor) – The learning label of the prediction.

  • weight (torch.Tensor, optional) – Sample-wise loss weight.

  • avg_factor (int, optional) – Average factor that is used to average the loss. Defaults to None.

Returns:

The calculated loss

Return type:

torch.Tensor

training: bool#