What is Matrix Multiplication in Machine Learning?

Matrix multiplication is among the most fundamental and compute-intensive operations in machine learning. The fundamental operations of any typical neural network can be reduced to a bunch of addition and multiplication operations. Neural networks can be expressed in terms of matrices.

Rules:
We can multiply two matrices if the number of rows in the 1st matrix is the same as the number of columns in the 2nd matrix, otherwise, we cannot apply multiplication between the matrices.

  1. Let’s say a matrix of size 2×3 and another matrix is of size 3×2, then we can apply the multiplication between those matrices because the number of columns and rows are the same in both the matrices. And the resultant matrix will be of 2×2

  2. Let’s say a matrix of size 3×3 and another matrix is of size 4×2, then we cannot apply the multiplication between those matrices because the number of columns and rows are not the same in both the matrices.