Loss ops
Generated from the binaries by scripts/gen-ops-reference.ts — do not edit by
hand. Every op also documents itself: torch <op> --help.
mse_loss
mean squared error (—reduction mean|sum|none)
torch mse_loss <t1> <t2> [--reduction <Str>]torch mse_loss <t1> <t2> [--reduction <Str>]l1_loss
mean absolute error (—reduction)
torch l1_loss <t1> <t2> [--reduction <Str>]torch l1_loss <t1> <t2> [--reduction <Str>]smooth_l1_loss
smooth L1 loss (—beta, default 1.0)
torch smooth_l1_loss <t1> <t2> [--reduction <Str>] [--beta <Float>]torch smooth_l1_loss <t1> <t2> [--reduction <Str>] [--beta <Float>]huber_loss
Huber loss (—delta, default 1.0)
torch huber_loss <t1> <t2> [--reduction <Str>] [--delta <Float>]torch huber_loss <t1> <t2> [--reduction <Str>] [--delta <Float>]cross_entropy
cross entropy over logits vs int64 class indices
torch cross_entropy <t1> <t2> [--reduction <Str>]torch cross_entropy <t1> <t2> [--reduction <Str>]nll_loss
negative log likelihood (log-prob inputs, int64 targets)
torch nll_loss <t1> <t2> [--reduction <Str>]torch nll_loss <t1> <t2> [--reduction <Str>]binary_cross_entropy
BCE over probabilities in [0,1]
torch binary_cross_entropy <t1> <t2> [--reduction <Str>]torch binary_cross_entropy <t1> <t2> [--reduction <Str>]binary_cross_entropy_with_logits
BCE over logits (the stable form)
torch binary_cross_entropy_with_logits <t1> <t2> [--reduction <Str>]torch binary_cross_entropy_with_logits <t1> <t2> [--reduction <Str>]kl_div
KL divergence (—log_target if target is log-space)
torch kl_div <t1> <t2> [--reduction <Str>] [--log_target]torch kl_div <t1> <t2> [--reduction <Str>] [--log_target]