Skip to content

Step by step explanation of 2D convolution implemented as matrix multiplication using toeplitz matrices

Notifications You must be signed in to change notification settings

yuan776/convolution_as_multiplication

Repository files navigation

Convolution as Matrix Multiplication

Step by step explanation of 2D convolution implemented as matrix multiplication using toeplitz matrices

What is the purpose?

Instead of using for-loops to perform 2D convolution on images (or any other 2D matrices) we can convert the filter to a Toeplitz matrix and image to a vector and do the convolution just by one matrix multiplication (and of course some post-processing on the result of this multiplication to get the final result)

Why do we do that?

There are many efficient matrix multiplication algorithms, so using them we can have an efficient implementation of convolution operation.

What is in this document?

Mathematical and algorithmic explanation of this process. I will put a naive Python implementation of this algorithm to make it more clear.

Implemented in python (jupyter notebook)
Look at the notebook or Look at this pdf in the repository for details

About

Step by step explanation of 2D convolution implemented as matrix multiplication using toeplitz matrices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published