3.3 Dot Product
With multiple inputs, the weighted sum can be written more compactly.
Shortening the Weight Vector
So (w) is not one weight. It is a vector containing all the individual weights: Think of:
For 3 inputs:
and:
The dot product is:
Expanding, it becomes:
So we can simply write the equation as ->
3.5 Dot Product in Python
Instead of writing every multiplication separately:
x = [2, 3]
w = [1, 1]
dot_product = w[0] * x[0] + w[1] * x[1]
print(dot_product)