What is the L1 norm of a vector?
The norm of a vector v is mathematically defined as follows:
When q=1, the vector norm is called the L1 norm. So, the L1 norm of a vector is mathematically defined as follows:
In other words, if we take the absolute value of each component of a vector and sum them up, we will get the L1 norm of the vector. The L1 norm is also called the Manhattan norm.
Let’s look at an example. Let’s say v is a vector as given below:
So, the L1 norm of the vector v will be:
How to calculate the L1 norm of a vector using Python?
We can use the following Python code to calculate the L1 norm of a vector using NumPy…






0 Comments