Mean Squared Error
Return the mean squared error between pred and target: the mean of the squares of their differences, element by element.
Example 1
pred [1.0,2.0,3.0]
target [1.0,4.0,0.0]
returns 4.333333333
Constraints
- Both have the same shape: 1 to 8 elements
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More PyTorch problems
- One Step DownhillMedium
- Two LayersMedium
- Two ParametersMedium
- Unit RowsMedium
- A Tiny NetworkHard
- Average the EmbeddingsHard
- Batch Norm by HandHard
- Clip the GradientHard