Answers.Body: <p>In machine learning, a tensor is a multidimensional array with some operations. In mathematics, the definition of a tensor is slightly different (see <a href="https://en.wikipedia.org/wiki/Tensor" rel="nofollow noreferrer">the Wikipedia article</a>). However, the definitions are related because mathematical tensors can be represented as multidimensional arrays. See e.g. <a href="https://math.stackexchange.com/q/1134809">this post</a>.</p>
  <p>In this book, the tensor product is defined as the numpy operation <a href="https://numpy.org/doc/stable/reference/generated/numpy.dot.html" rel="nofollow noreferrer"><code>np.dot</code></a>, which can perform the mathematical dot product (aka inner product), matrix multiplication, etc., depending on the dimensionality of the inputs.</p>
  <p>So, in conclusion, terms are overloaded and can vary across disciplines and you should always take the context into account.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-29T10:27:32.823Z
Answers.LastActivityDate: 2024-01-29T10:27:32.823Z
Answers.UserDisplayName: nbro
Body: <p>I'm currently reading &quot;Deep Learning with Python, Second Edition&quot; by François Chollet, and I need help understanding one thing.</p>
  <p>Below paragraph was copied from the page 41</p>
  <blockquote>
  <p><strong>2.2.3 Tensor product</strong></p>
  <p>The tensor product, or dot product (not to be confused with an element-wise product, the
  * operator), is one of the most common, most useful tensor operations.
  In NumPy, a tensor product is done using the <code>np.dot</code> function (because the mathematical notation for tensor product is usually a dot)</p>
  </blockquote>
  <p>What has been described later in that section looks like a dot product to me (I don't have mathematical background though, I've just recently taken an interest in the subject), but this term also seems to be used interchangeably with &quot;Tensor product&quot;.</p>
  <p>However, according to every other source I've came across - dot product and tensor product are two different things (example: <a href="https://en.wikipedia.org/wiki/Dot_product" rel="nofollow noreferrer">wikipedia article on dot product</a> and <a href="https://en.wikipedia.org/wiki/Tensor_product" rel="nofollow noreferrer">wikipedia article on tensor product</a>).</p>
  <p>Is this an error in the book or am I missing something obvious here?</p>
  
Tags: <deep-learning><terminology><books><tensor>
Title: Are the Dot Product and Tensor Product the same thing in Machine Learning?
UserDisplayName: Kamil Bęben
ThreadText: # Are the Dot Product and Tensor Product the same thing in Machine Learning?
  
  (Asked by: username_0 on 2024-01-27)
  
  I'm currently reading "Deep Learning with Python, Second Edition" by François Chollet, and I need help understanding one thing.
  
  Below paragraph was copied from the page 41
  
  > **2.2.3 Tensor product**
  >
  > The tensor product, or dot product (not to be confused with an element-wise product, the
  > \* operator), is one of the most common, most useful tensor operations.
  > In NumPy, a tensor product is done using the `np.dot` function (because the mathematical notation for tensor product is usually a dot)
  
  What has been described later in that section looks like a dot product to me (I don't have mathematical background though, I've just recently taken an interest in the subject), but this term also seems to be used interchangeably with "Tensor product".
  
  However, according to every other source I've came across - dot product and tensor product are two different things (example: [wikipedia article on dot product](https://en.wikipedia.org/wiki/Dot_product) and [wikipedia article on tensor product](https://en.wikipedia.org/wiki/Tensor_product)).
  
  Is this an error in the book or am I missing something obvious here?
  
  **Tags:** deep-learning, terminology, books, tensor
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-29. Score: 4 | Accepted answer
  
  In machine learning, a tensor is a multidimensional array with some operations. In mathematics, the definition of a tensor is slightly different (see [the Wikipedia article](https://en.wikipedia.org/wiki/Tensor)). However, the definitions are related because mathematical tensors can be represented as multidimensional arrays. See e.g. [this post](https://math.stackexchange.com/q/1134809).
  
  In this book, the tensor product is defined as the numpy operation [`np.dot`](https://numpy.org/doc/stable/reference/generated/numpy.dot.html), which can perform the mathematical dot product (aka inner product), matrix multiplication, etc., depending on the dimensionality of the inputs.
  
  So, in conclusion, terms are overloaded and can vary across disciplines and you should always take the context into account.
  
  
  ---
  
  