SoftmaxCrossEntropyLoss

Description

Computes the Softmax cross entropy loss.

Input

Three inputs:

scores: tensor of type float16 or float, with shape [batch_size, class_size] or [batch_size, class_size, D1, D2, ..., Dk] (K indicates the number of dimensions).

labels: tensor of type int32 or int64, with shape [batch_size] or [batch_size, D1, D2, ..., Dk] (K indicates the number of dimensions).

weights: tensor of type float16 or float.

Output

Two outputs:

output: tensor of type float16 or float, with shape [batch_size] or [batch_size, D1, D2, ..., Dk], when reduction is set to none and K-dimensional loss occurs.

log_prob: log probability tensor. If the output of Softmax is prob, its value is log(prob). A tensor of type float16 or float, with shape=[batch_size, class_size] or [batch_size, class_size, D1, D2, ..., Dk] (K indicates the number of dimensions).

Property

ignore_index: (optional) target value that is ignored and does not affect the input gradient. The value is an integer.

reduction: none, mean (default value), or sum.

Constraints

This operator supports only the Atlas inference products.

ONNX Opset Support

Opset v12/v13/v14/v15/v16/v17/v18