# mse

## Description

The half mean squared error operation computes the half mean squared error loss between network predictions and target values for regression tasks.

The loss is calculated using the following formula

$$\text{loss}=\frac{1}{2N}{\displaystyle \sum _{i=1}^{M}{({X}_{i}-{T}_{i})}^{2}}$$

where *X _{i}* is the network
prediction,

*T*is the target value,

_{i}*M*is the total number of responses in

*X*(across all observations), and

*N*is the total number of observations in

*X*.

**Note**

To train a network using the `trainnet`

function with mean square error loss, set the loss function to
`"mse"`

.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

## Extended Capabilities

## Version History

**Introduced in R2019b**