fchollet/deep-learning-with-python-notebooks

Chaper 2: Tensor product terminology used incorrectly

Opened this issue · 0 comments

The text says:

Tensor product
The tensor product, also called dot product or matmul (short for “matrix multiplication”) is one of the most common, most useful tensor operations.

In NumPy, a tensor product is done using the np.matmul function, and in Keras, with the keras.ops.matmul function. Its shorthand is the @ operator in Python:

This incorrectly identifies "tensor product" with "dot product" and "matmul". These are distinct operations:

  • Matrix multiplication/dot product/contraction (np.matmul, @): Contract/sum over indices, giving result no bigger than inputs

  • Tensor/outer product (np.outer, np.kron): Preserve all indices, increase dimensionality relative to each input

Suggested correction: Replace "tensor product" with "tensor contraction" or, more informally but still better, "tensor multiplication".