How to calculate norm of 2D array? I can do it using python but not able to understand how to do it manually.
Also, when I explicitly provide “ord = 2” in norm function, I am getting slightly different answer than without it. (6.0 and 5.92…)
Norm of 2D array
You can do it manually by adding square of all values in the matrix and than taking the square root.
You are getting different output because when you don’t specify any attribute then l2 norm is returned where as when you specify ord = ‘2’ then 2-norm (largest sing. value) is returned which is not same as l2 norm. You can verify this from official documentation of numpy.
Hope this cleared your doubt.