greatlog / DAN

This is an official implementation of Unfolding the Alternating Optimization for Blind Super Resolution
231 stars 41 forks source link

About the 'kernel_code'? #29

Closed yiyunchen closed 3 years ago

yiyunchen commented 3 years ago

hello, I am confused about the generation process of 'kernel_code'. When calculating the PCA matrix, the code do 'X = X - X_mean.expand_as(X)' before get the PCA matrix. Then, in 'PCAEncoder', It seems direct projection by 'torch.bmm( batch_kernel.view((B, 1, H * W)), self.weight.expand((B,) + self.size) ).view((B, -1))' without '- X_mean'. Did we need '- X_mean'?

Thank you!

greatlog commented 3 years ago

Sorry, I have misunderstood your question. We only need ' - X_mean' when we create the PCA matrix. While when we use this PCA matrix to encode other kernels, we do not need to zero their mean values.