# huber

Huber loss for regression tasks

## 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 L_{1} 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(`dlY`

,`targets`

)`dlarray`

object
`dlY`

containing the predictions and the target values
`targets`

for regression tasks. The input `dlY`

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 `dlY`

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

## Output Arguments

## Algorithms

## Extended Capabilities

## See Also

`dlarray`

| `dlgradient`

| `dlfeval`

| `softmax`

| `sigmoid`

| `crossentropy`

| `mse`

| `l1loss`

| `l2loss`

**Introduced in R2021a**