Answers.Body: <p>Yes you can vectorize a CNN. See this github file for details: <a href="https://github.com/parasdahal/deepnet/blob/master/deepnet/layers.py" rel="nofollow noreferrer">https://github.com/parasdahal/deepnet/blob/master/deepnet/layers.py</a></p>
  
  <p>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. </p>
  
  <p>Hope this can help you and have a nice day!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-04T05:18:24.550Z
Answers.LastActivityDate: 2019-11-04T05:18:24.550Z
Answers.UserDisplayName: Clement
Body: <p>I am trying to write a CNN from scratch and am wondering if it is possible to vectorize the convolution step.</p>
  <p>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?</p>
  <p>Currently, I am running through all 500 images in a <code>for</code> 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.</p>
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-11T01:09:00.363Z
Comments.Text: related: https://medium.com/analytics-vidhya/implementing-convolution-without-for-loops-in-numpy-ce111322a7cd
Comments.UserDisplayName: pasaba por aqui
Tags: <neural-networks><convolutional-neural-networks><convolution>
Title: Is it possible to vectorise a CNN?
UserDisplayName: FeedMeInformation
ThreadText: # Is it possible to vectorise a CNN?
  
  (Asked by: username_0 on 2019-11-04)
  
  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.
  
  **Tags:** neural-networks, convolutional-neural-networks, convolution
  
  > **Comments:**
  > **username_1**: related: https://medium.com/analytics-vidhya/implementing-convolution-without-for-loops-in-numpy-ce111322a7cd  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-11-04. Score: 1
  
  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!
  
  
  ---
  
  