5
$\begingroup$

I am trying to write a CNN from scratch and am wondering if it is possible to vectorize the convolution step.

For example, if I had a dataset of 500 RGB images of size 32x32x3, and wanted the first convolutional layer to have 64 filters, how would I go about the vectorization of this layer?

Currently, I am running through all 500 images in a for loop, convoluting individually. I do this for all the images up to the flattening stage (where it essentially becomes a normal NN again), at which point I can implement the normal vectorisation approach to get to my output, etc.

A holistic overview of the process would be appreciated, as I am struggling to get my head around it and am struggling to find and information on the matter online.

$\endgroup$
1

1 Answer 1

1
$\begingroup$

Yes you can vectorize a CNN. See this github file for details: https://github.com/parasdahal/deepnet/blob/master/deepnet/layers.py

After looking through it it basically transposes the input to some dimension and apply matrix multiplication to the weight with some other kind of transfromation. Pls refer to the github repository for details.

Hope this can help you and have a nice day!

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .