Closed Diksha-Moolchandani closed 1 year ago
As you describe the up-sampling is done with just inserting zeros and those zeros get multiplied with kernel to produce zero. More optimal thing would be to not upscale before convolution.
http://d2l.ai/chapter_computer-vision/transposed-conv.html shows mxNet/python code for deconvolution. If we were writing it in C/C++ the more elaborate code would be:
for (w = 0; w < IW; ++w)
for (h = 0; h < IH; ++h)
for (r = 0; r < FW; ++r)
for (s = 0; s < FH; ++s)
Y[h+s][w+r] += I[h][w] * W[s][r]
This can be expressed in timeloop as below:
Running this example indeed shows: MACCs = 16 Utilized capacity 4 for inputs and weights and 9 for Outputs as expected and shown in the diagram in the website.
Hi,
Can the deconvolution / transposed convolution layer be modeled / handled in timeloop? Is there an example to specify this problem in yaml?
Deconvolution is essentially convolution with upsampling. The input feature maps are upsampled by inserting zeros in between original values and then the feature map is convolved with a filter.
So, my plan is to use the upsampled feature map as input and consider it as a normal convolution. Then I can either use the construct_workloads.py script from timeloop-accelergy-exercises or manually generate the yaml file.
Is this the right approach?