We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
← Loss Functions step 1 of 8
Easy
Primitives
Implement Mean Squared Error
Implement the Mean Squared Error (MSE) loss function.
$$\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2$$
Input: Two 1D tensors y_true and y_pred of the same shape
Output: A scalar tensor representing the mean squared error
Loading visualization…
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.