# l2loss

## Syntax

## Description

The L_{2} loss operation computes the
L_{2} loss (based on the squared L_{2} norm) given
network predictions and target values. When the `Reduction`

option is
`"sum"`

and the `NormalizationFactor`

option is
`"batch-size"`

, the computed value is known as the mean squared error
(MSE).

The `l2loss`

function calculates the L_{2} 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.

specifies additional options using one or more name-value arguments. For example,
`loss`

= l2loss(___,`Name=Value`

)`l2loss(Y,targets,Reduction="none")`

computes the
L_{2} loss without reducing the output to a scalar.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

## Extended Capabilities

## Version History

**Introduced in R2021b**