CycleGAN icon indicating copy to clipboard operation
CycleGAN copied to clipboard

where does the code implement the averaging operation following the PatchGAN?

Open knaffe opened this issue 6 years ago • 2 comments

I have a question on the implement of PatchGAN. In the Section 3.2.2 of the paper, it said

We run this discriminator convolutationally across the image, averaging all responses to provide the ultimate output of D.

But I couldn't find anywhere to implement of this averaging operation? In the code, the D outputs the 30x30x1 feature map data, and the loss of D is calculated by the GANLoss function(MSE or BCE loss) with the 30x30x1 feature map. Where does the averaging operation? Maybe I miss something. Thank you !

knaffe avatar Jun 03 '18 01:06 knaffe

In the code, we first calculate the loss on the 30x30 map and then average the loss. @phillipi

junyanz avatar Jun 09 '18 03:06 junyanz

@knaffe Did you figure it out? I still dont understand how they average the (n, 1, 30, 30) output into a (n, 1) which can then be fed into a BCELoss function?

mannoppilly avatar Oct 23 '19 09:10 mannoppilly