![]() The linalg module in NumPy has functions that we can use to compute norms.īefore we begin, let’s initialize a vector: ![]() It’s fairly straightforward to verify that all of these norms satisfy the properties of norms listed earlier. Substituting p =2 in the general Lp norm equation, we get the following expression for the L2 norm of a vector:įor a given vector x, the L∞ norm is the maximum of the absolute values of the elements of x: The L1 norm is equal to the sum of the absolute values of elements in the vector: Let’s take a look at the common vector norms, namely, the L1, L2 and L∞ norms.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |