HistoGAN icon indicating copy to clipboard operation
HistoGAN copied to clipboard

No parameters for RGBuvHistBlock?

Open sidsingla opened this issue 2 years ago • 4 comments

Hi, I am checking the parameters for RGBuvHistBlock as the gradients for the parameters of the block are being set here - https://github.com/mahmoudnafifi/HistoGAN/blob/dc543f89c046f775b404cc5a4f15271e9d0e1c23/histoGAN/histoGAN.py#L741

What I am seeing is the block doesn't have parameters. Could anyone confirm if this is the case? And if yes, how is the block getting trained without having parameters and hence, no gradients?

I just want to use this block and not the whole GAN architecture for my own case.

Thanks!

sidsingla avatar Jul 01 '22 00:07 sidsingla

That is true, the block does not have learnable params. It comprises a set of differentiable operations to compute the histogram and it is helpful to compute histogram loss (like the case in this paper) or you may use it to compute the histogram of network intermediate images during training (check this paper for example). In the latter case, you may need to introduce some learnable parameters that control some properties of the histogram feature (e.g., the smoothness of each bin).

mahmoudnafifi avatar Jul 01 '22 02:07 mahmoudnafifi

Thank you so much! The explanation helps a lot. That means the line 741 shared above doesn't makes sense and it can be removed!

sidsingla avatar Jul 06 '22 15:07 sidsingla

Yes, I forgot to remove it after some early experiments that include learnable parameters in the histogram feature.

mahmoudnafifi avatar Jul 06 '22 15:07 mahmoudnafifi

I can raise a PR to remove it if you want.

sidsingla avatar Jul 06 '22 15:07 sidsingla