Reputation: 155
For reducing the number of feature maps in a 4D tensor, it is possible to use Conv2d while keeping the height and width of that tensor as the same as before. To be clearer, For example for the following 4D tensor [batch_size, feature_maps, height,weight] I use the following approach for reducing the number of feature maps but the height and size will be the same as before:
self.channel_reduction = nn.Conv2d(1024, 512, kernel_size=1, stride=1)
But I have the following 5D tensor [batch_size, feature_maps, num_frames, height, width] (e.g. [16, 1024, 16, 56, 56]) and I want to reduce the number of feature maps from 1024 to 512 while keeping the height and width size as the same as before (e.g. [16, 1024, 16, 56, 56]). How can I reduce the number of feature maps?
Upvotes: 0
Views: 362
Reputation: 4826
self.channel_reduction = nn.Conv3d(1024, 512, kernel_size=1, stride=1)
Upvotes: 2