I want to make an addition of two square root functions, not one inside another. here is my code:
\begin{equation}
L=\sqrt{\frac{1}{n} \sum_{i=1}^{n}\left\left\|y_{pred} -y_{true}\right\|_{2}} +
\sqrt{\frac{1}{n} \sum_{i=1}^{n}\left\left\|y_{pred1} -y_{pred2}\right\|_{2}}
\end{equation}
And the output is:
Can anyone tell me what's the right way to do this?

y_{\mathrm{pred}}. Additionally all the\left...\rightin this example does nothing. – daleif Apr 19 '21 at 10:22^2instead of_2in all instances of\right\|_{2}? – Mico Apr 19 '21 at 10:35\lVert_pnorm? – daleif Apr 19 '21 at 10:37\|is a bad symbol to use for norm, use\lVert ... \rVertinstead. Why? Try\| -1 \|and\lVert -1 \rVert. – daleif Apr 19 '21 at 10:38Lis defined as the square root of the average of a bunch of terms, these terms better be the squared norms rather than just the norms themselves. Actually, there's another fairly serious deficiency in the OP's notation: the summation is taken over a bunch of terms indexed byi, yet none of terms being summed has anicomponent. – Mico Apr 19 '21 at 15:22