In this task, you need to implement a function cosine_similarity(v1, v2) that calculates the cosine similarity between two vectors. Cosine similarity measures the cosine of the angle between two vectors, indicating their directional similarity.
Input:
v1 and v2: Numpy arrays representing the input vectors.Output:
Constraints: