It’s a matter of learning a downsampling method versus using an existing method (average pooling). It’s hard to say which is better (thus why you might see a bit of both in literature).
I think using average pooling makes a lot of sense in, say, image domains. This allows the model to capture fine details in the early layers and coarse details in the average downsampled features.
I think using a learned downsampling would makes sense when my data doesn’t have spatial connections. That is, values “next” to eachother aren’t related. Average pooling sort of assumes that they do, thus I would probably go with a learned downsampling.
For upsampling, it’s essentially the same scenario, a learned upsampling or an existing upsampling technique. You can use torch.nn.functional.interpolate to upsample something using existing techniques. You can either use a linear layer or a transposed convolution to get a learned upsampling.
Hopes this helps