API symbolsnn
Copy
tensorplay.nn.functional.cross_entropy
- tensorplay.nn.functional.cross_entropy(input, target, weight=None, size_average=None, ignore_index=-100, reduce=None, reduction='mean', label_smoothing=0.0)[source]
Compute the cross entropy loss between input logits and target.
Port of at::native::cross_entropy_loss_symint (aten/src/ATen/native/LossNLL.cpp:633): equal input/target shapes select the class-probability path, positive
label_smoothingblends the NLL with a smoothed uniform term, and otherwise this isnll_loss(log_softmax(input), target)with N-d support.See
CrossEntropyLossfor details.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?
