Loss ops

Unreleased native NuTorch shell reference. Generated by scripts/gen-ops-reference.ts; every op also documents itself with torch <op> --help. Tensor operands are native values, not strings.

mse_loss

mean squared error (—reduction mean|sum|none)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch mse_loss <t1> <t2> [--reduction <Str>]

l1_loss

mean absolute error (—reduction)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch l1_loss <t1> <t2> [--reduction <Str>]

smooth_l1_loss

smooth L1 loss (—beta, default 1.0)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch smooth_l1_loss <t1> <t2> [--reduction <Str>] [--beta <Float>]

huber_loss

Huber loss (—delta, default 1.0)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch huber_loss <t1> <t2> [--reduction <Str>] [--delta <Float>]

cross_entropy

cross entropy over logits vs int64 class indices

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch cross_entropy <t1> <t2> [--reduction <Str>]

nll_loss

negative log likelihood (log-prob inputs, int64 targets)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch nll_loss <t1> <t2> [--reduction <Str>]

binary_cross_entropy

BCE over probabilities in [0,1]

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch binary_cross_entropy <t1> <t2> [--reduction <Str>]

binary_cross_entropy_with_logits

BCE over logits (the stable form)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch binary_cross_entropy_with_logits <t1> <t2> [--reduction <Str>]

kl_div

KL divergence (—log_target if target is log-space)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch kl_div <t1> <t2> [--reduction <Str>] [--log_target]