The dot product measures how much two vectors point in the same direction — and in neural networks, it is the operation that decides which side of a boundary a data point falls on.

Definition

For two vectors and , the dot product is:

This is also called the inner product or scalar product.

Geometric interpretation

The dot product has an equivalent geometric form:

where is the angle between the two vectors and denotes the Euclidean length (norm).

The sign of determines the sign of the dot product:

ConditionAngleDot product
Vectors point in the same directionPositive
Vectors are perpendicularZero
Vectors point in opposite directionsNegative

Signed distance to a hyperplane

This is where the dot product becomes central to classification. Consider a hyperplane passing through the origin, defined by a normal vector . For any point :

where is the signed perpendicular distance from to the hyperplane. Points on the same side as have ; points on the opposite side have ; points on the hyperplane have .

When (unit vector), the dot product equals the signed distance directly. In general, the dot product gives the distance scaled by .

Role in the perceptron

The perceptron computes . The dot product measures the signed distance from to the decision boundary . The sign function then maps this distance to a class label:

  • Positive distance (same side as ) class
  • Negative distance (opposite side) class

The bias shifts the hyperplane away from the origin, but the dot product still does the core geometric work.

  • perceptron — uses the dot product as its core computation
  • decision boundary — the hyperplane whose signed distance the dot product measures

Active Recall