KernelGAN icon indicating copy to clipboard operation
KernelGAN copied to clipboard

Why do you swap axis?

Open jiandandan001 opened this issue 4 years ago • 2 comments

Hi, thank you for sharing the code!

It seems that you first swap the axis first in the generator. Could you tell me why do you swap axis? More efficient, fewer parameters, or other reasons? Thanks.

################# def forward(self, input_tensor): # Swap axis of RGB image for the network to get a "batch" of size = 3 rather the 3 channels input_tensor = swap_axis(input_tensor) downscaled = self.first_layer(input_tensor) features = self.feature_block(downscaled) output = self.final_layer(features) return swap_axis(output) ###########################

jiandandan001 avatar Jun 29 '21 00:06 jiandandan001

I change the dimensions from 1,3,H,W to 3,1,H,W because this way the first layer is 1,Cout,k,k rather then 3,Cout,k,k`. The reason this is important is because I want a single SR kernel for the entire image and not a different kernel per channel. LMK if this is unclear

sefibk avatar Jun 29 '21 06:06 sefibk

I change the dimensions from 1,3,H,W to 3,1,H,W because this way the first layer is 1,Cout,k,k rather then 3,Cout,k,k`. The reason this is important is because I want a single SR kernel for the entire image and not a different kernel per channel. LMK if this is unclear

I see. Thanks.

jiandandan001 avatar Jun 29 '21 06:06 jiandandan001