sefibk / KernelGAN

Other
337 stars 77 forks source link

Why do you swap axis? #64

Open jiandandan001 opened 3 years ago

jiandandan001 commented 3 years ago

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)

###########################

sefibk commented 3 years ago

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 then3,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

jiandandan001 commented 3 years ago

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 then3,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.