Understand Vector Dot Product: A Beginner Introduction – Machine Learning Tutorial

By | October 11, 2020

Vector dot product is widely used in machine learning. In this tutorial, we will introduce it for machine learning beginners.

What is vector dot product?

Given two vectors A and B, the dot product between them are defined as:

dot product

We can find the result of two vector dot product is a scalar.

The difference between vector dot product and element-wise multiplication

Vector dot product is different from element-wise multiplication, the  element-wise multiplication (product) can be defined as:

element-wise multiplication between two vector in machine learning

Understand Element-wise Multiplication Between Two Vector – Machine Learning Tutorial

From above, we can find:

dot product(A, B) = sum(element-wise multiplication(A, B))

How to calculate the vector dot product?

In tensorflow:

We can use tf.tensordot() function to compute.

In numpy:

We can use numpy.dot() to compute.

Calculate Dot Product of Two Vectors in Numpy for Beginners – Numpy Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *