Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Glossary › Dot product

What is dot product?

Multiply matching entries of two vectors and add the results. It is large when the vectors point the same way and zero when they are at right angles.

Where it is taught

The dot product. One number that says how much two vectors point the same way. It is the most used calculation in all of AI.

What the lesson leaves you with

  • a⋅b\mathbf{a} \cdot \mathbf{b}a⋅b multiplies matching entries and adds them up, giving one number.
  • It is positive for similar directions, zero for perpendicular, negative for opposite.
  • Cosine similarity divides out the lengths so that only direction counts.
Open the lesson

Questions

What is dot product?
Multiply matching entries of two vectors and add the results. It is large when the vectors point the same way and zero when they are at right angles.
Where is dot product used in AI?
One number that says how much two vectors point the same way. It is the most used calculation in all of AI.
What is the key idea to remember about dot product?
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">a</mi><mo>⋅</mo><mi mathvariant="bold">b</mi></mrow><annotation encoding="application/x-tex">mathbf{a} cdot mathbf{b}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="katex-base"><span class="katex-strut" style="height:0.4445em;"></span><span class="mord mathbf">a</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="katex-base"><span class="katex-strut" style="height:0.6944em;"></span><span class="mord mathbf">b</span></span></span></span> multiplies matching entries and adds them up, giving one number.
Where can I learn dot product step by step?
In the lesson “The dot product” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.

See it in 3D on the blog

  • What is a dot product? Explained with examples5 min

Related terms

  • Cosine similarity
  • Embedding
  • Nearest neighbours
  • Parameter
  • Vector