In this short post, we learn how to obtain the transpose of a matrix and how to perform operations with a matrix transpose.
The transpose of a matrix is a matrix that is obtained by flipping the original matrix over its diagonal. In other words, the rows of a matrix become the columns of its transpose, while its columns become the rows of the transpose. For a 2 dimensional square matrix, it would look like this.
1 & 2 \\
3 & 4 \\
1 & 3 \\
2 & 4 \\
If you have more dimensions and the matrix is not square, you can also obtain the transpose over its diagonal. Note that now you also have to flip the dimensions.
1 & 2 & 3\\
4 & 5 & 6 \\
1 & 4 \\
2 & 5 \\
3 & 6 \\
If you transpose the transpose of a matrix A, you arrive back at your original matrix A.
The transpose of the sum of two matrices equals the sum of the transposes of the original elements.
If you transpose the product of several matrices, the product is equivalent to the transposes of the original matrices in reversed order.
This post is part of a series on linear algebra for machine learning. To read other posts in this series, go to the index.