Number of channels

  • Round up the number of channels in a layer to a multiple of 32 (32, 64, 96, 128, …), when designing the network.

  • In grouped convolution the group size is greater than 1, in contrast to normal convolution where the group size is 1. What this means is that the input channels are grouped into a number of groups equal to group-size and each group is convolved with a different group of filters. This is shown in the Figure 10 below:

../../_static/resources/htp_guidelines_fig_10.png

Grouped Convolution

  • Here the input channels are grouped into g groups (2 groups in the figure above). Each group is convolved with its own set of filters (Dark blue channels are convolved with dark green filters and light blue with light green). The outputs from the convolution groups are then concatenated along channel dimension. To achieve better MAC/memory efficiency it is important to keep the following in mind:

    • When doing grouped convolution, try to have more channels in a group up to the hardware capacity of 32.

    • For better efficiency use group convolution with group sizes greater than 1 and preferably with number of channels being small power-of-2.

    • Do not choose group sizes to be unnessarily large. Choose group sizes as the smallest power-of-2 after which the doubling of the group size doesn’t significantly increase the accuracy. E.g. if the group sizes 2 and 4 achieve similar accuracy then select 2 as the group size