- Hands-On Mathematics for Deep Learning
- Jay Dawani
- 437字
- 2021-06-18 18:55:09
Multiplying matrices
So far, we have only multiplied a matrix by a column vector. But now, we will multiply a matrix A with another matrix B.
There are four simple rules that will help us in multiplying matrices, listed here:
- Firstly, we can only multiply two matrices when the number of columns in matrix A is equal to the number of rows in matrix B.
- Secondly, the first row of matrix A multiplied by the first column of matrix B gives us the first element in the matrix AB, and so on.
- Thirdly, when multiplying, order matters—specifically, AB ≠ BA.
- Lastly, the element at row i, column j is the product of the ith row of matrix A and the jth column of matrix B.
Let's multiply an arbitrary 4x5 matrix with an arbitrary 5x6 matrix, as follows:

This results in a 4x6 matrix, like this:

From that, we can deduce that in general, the following applies:

Let's take the following two matrices and multiply them, like this:

This will give us the following matrix:
.
The identity matrix has two unique properties in matrix multiplication. When multiplied by any matrix, it returns the original matrix unchanged, and the order of multiplication does not matter—so, AI = IA = A.
For example, let's use the same matrix A from earlier, and multiply it by another matrix B, as follows:

Another very special matrix is the inverse matrix, which is written as A-1. And when we multiply A with A-1, we receive I, the identity matrix.
As mentioned before, the order in which we multiply matters. We must keep the matrices in order, but we do have some flexibility. As we can see in the following equation, the parentheses can be moved:

This is the first law of matrix operations, known as associativity.
The following are three important laws that cannot be broken:
- commutativity:
- distributivity:
or
- associativity:
As proof that AB ≠ BA, let's take a look at the following example:

This conclusively shows that the two results are not the same.
We know that we can raise numbers to powers, but we can also raise matrices to powers.
If we raise the matrix A to power p, we get the following:
(multiplying the matrix by itself p times)
There are two additional power laws for matrices— and
.
- 大數據可視化
- Visual Studio 2015 Cookbook(Second Edition)
- 正則表達式必知必會
- Access 2016數據庫技術及應用
- Creating Dynamic UIs with Android Fragments(Second Edition)
- 深度剖析Hadoop HDFS
- 數據庫原理與應用(Oracle版)
- MySQL 8.x從入門到精通(視頻教學版)
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- MySQL DBA修煉之道
- R Object-oriented Programming
- MySQL數據庫技術與應用
- 利用Python進行數據分析(原書第2版)
- Arquillian Testing Guide
- 數據庫基礎與應用