Shortcuts

torch.nn.functional.huber_loss

torch.nn.functional.huber_loss(input, target, reduction='mean', delta=1.0)[source]

Compute the Huber loss.

Function uses a squared term if the absolute element-wise error falls below delta and a delta-scaled L1 term otherwise.

When delta equals 1, this loss is equivalent to SmoothL1Loss. In general, Huber loss differs from SmoothL1Loss by a factor of delta (AKA beta in Smooth L1).

See HuberLoss for details.

Return type

Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources