GANs-in-Action / gans-in-action

Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
1.02k stars 422 forks source link

Chapter6 minibatch_std_layer function #8

Open youngsend opened 4 years ago

youngsend commented 4 years ago

Dear Authors, I have several questions about the minibatch_std_layer function. 1.original code: # Calculate the standard deviation over the group [M,W,H,C] minibatch = K.backend.square(minibatch + 1e8) Since here standard deviation should be calculated, I think this line should be minibatch = K.backend.sqrt(minibatch + 1e-8)

  1. original code: # Take average over feature maps and pixels [M,1,1,1] minibatch = tf.reduce_mean(minibatch, axis=[1,2,4], keepdims=True) Why is axis=[1,2,4]? I think it should be axis=[1,2,3].

  2. original code: shape = list(K.int_shape(input)) Does "input" mean "layer"?

  3. I do not understand why group_size is considered here. Can you please explain why group_size is necessary?