The dot product multiplies two vectors position by position and adds up the results:
a · b = Σ a[i] * b[i]
Task: write dot_product(vector_a, vector_b) returning the result, rounded to 4 decimal places.
0.Almost everything is built on this. A matrix multiply is a grid of dot products, a neuron's pre-activation is one against its weights, and attention scores every query against every key the same way. It's also a similarity measure: perpendicular vectors give exactly zero, which is what the second test case shows.