0

Given a convolutional layer, I am interested in recovering the weight matrix $W$, where $w_{i,j}$ is the weight between neuron $i$ in the input layer and neuron $j$ in the output layer. I know that most of these will be zero (e.g. for a 3x3 kernel there will only be 9 nonzero elements). In other words, I want to find the equivalent fully-connected layer to this convolutional layer.

Bonus points for any pytorch code.

Josh Bone
  • 123
  • 7
  • This question already has answers at https://stackoverflow.com/questions/16798888/2-d-convolution-as-a-matrix-matrix-multiplication and https://ai.stackexchange.com/questions/11172/how-can-the-convolution-operation-be-implemented-as-a-matrix-multiplication – Taw Oct 11 '21 at 01:15

0 Answers0