Norm is the generalization of the notion of "length" to vectors, matrices and tensors.
A norm is any function f that statisfies the following 3 conditions:
f(x)=0=>x=0
Triangular Inequality: f(x+y)≤f(x)+f(y)
Linearity: f(αx)=∣α∣f(x)
There are 2 reasons to use norms:
To estimate how "big" a vector or matrix or a tensor is.
To estimate "how close" one tensor is to another:
∣∣△v∣∣=∣∣v1−v2∣∣
Euclidean Norm
The euclidean norm is given by the below equation:
∣∣v∣∣2=(v12+v22+...+vn2)1/2 It is also called 2-norm or L2 norm. A vector of length one is said to be a unit vector.
There is a relation between euclidean norm and dot product.
vTv=v0v1...vn−1Tv0v1...vn−1=(v0v1...vn−1)v0v1...vn−1=v02+v12+...+vn−12 Thus, we can observe that:
∣∣v∣∣2=vTv The length of a vector also equals the square root of the dot product of the vector with itself.
Absolute Value of A Complex Number
Consider the following complex number:
χ=χr+χci,wherei=−1 Then, absolute value of a complex number is given by
∣χ∣=χr2+χc2=χχwhereχ=χr−χci χ is also called the conjugate of χ. Following are the properties of absolute value of a complex number:
χ=0=>∣χ∣>0. This also means that the norm is positive definite.
∣αχ∣=∣α∣∣χ∣. This means that the norm is homogenous.
∣χ+ψ∣≤∣χ∣+∣ψ∣. This means that the norm obeys triangle inequality.
Length of A 2D Vector
Let x∈R2andx=(χ0χ1). The (Euclidean) length of x is given by:
χ02+χ12 Slicing & Dicing: Dot Product
Consider the dot product of 2 vectors x and y. The dot product can be given:
Partitioning the vectors making sure that corresponding sub-vectors have the same size.
Then, we take the dot product of the corresponding sub-vectors and add all those together.
xTy=x0x1...xN−1=y0y1...yN−1=x0Ty0+x1Ty1+...+xN−1TyN−1=i=0∑N−1xiTyi Algorithm: Dot Product
Following details the algorithm to calculate dot product using slicing and dicing:
Partitionx→xTxB,y→yTyBwherexTandyThave0elementsα:=0whilem(xT)<m(x)doRepartitionxT⋯xB→x0⋯χ1x2,yT⋯yB→y0⋯ψ1y2whereχ1has1row,ψ1has1rowα:=χ1×ψ1+αContinuewithxT⋯xB←x0χ1⋯x2,yT⋯yB←y0ψ1⋯y2endwhile 1-Norm
This is given by the following equation:
∣∣v∣∣1=∣v1∣+∣v2∣+...+∣vn∣ p-Norm
This is given the following equation:
∣∣v∣∣p=(∣v1∣p+∣v2∣p+...+∣vn∣p)1/p∀p≥1 ∞-Norm
∞-Norm is also called max-norm. Following is the given equation for it:
∣∣v∣∣∞=max(∣v∣1,∣v∣2,...,∣vn∣) Frobenius Norm
Frobenius Norm is calculated for matrices:
AF=(i,j∑Ai,j2)1/2 Also, Af and A2 are not the same as denoted by the below equation:
∣∣A∣∣F=∣∣A∣∣2