huber
Syntax
Description
The Huber operation computes the Huber loss between network predictions and target values for regression tasks. When the 'TransitionPoint' option is 1, this is also known as smooth L1 loss.
The huber function calculates the Huber loss using dlarray data.
Using dlarray objects makes working with high
dimensional data easier by allowing you to label the dimensions. For example, you can label
which dimensions correspond to spatial, time, channel, and batch dimensions using the
"S", "T", "C", and
"B" labels, respectively. For unspecified and other dimensions, use the
"U" label. For dlarray object functions that operate
over particular dimensions, you can specify the dimension labels by formatting the
dlarray object directly, or by using the DataFormat
option.
returns the Huber loss between the formatted loss = huber(Y,targets)dlarray object
Y containing the predictions and the target values
targets for regression tasks. The input Y is a
formatted dlarray. The output loss is an unformatted
dlarray scalar.
For unformatted input data, use the 'DataFormat'
option.
also specifies the dimension format loss = huber(___,'DataFormat',FMT)FMT when Y is not
a formatted dlarray.
specifies options using one or more name-value pair arguments in addition to the input
arguments in previous syntaxes. For example,
loss = huber(___,Name,Value)'NormalizationFactor','all-elements' specifies to normalize the loss by
dividing the reduced loss by the number of input elements.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Algorithms
Extended Capabilities
Version History
Introduced in R2021a