pix2pix-tensorflow icon indicating copy to clipboard operation
pix2pix-tensorflow copied to clipboard

controlling patch size

Open eyaler opened this issue 8 years ago • 8 comments

can we allow controlling the patch size explicitly?

eyaler avatar Dec 22 '16 15:12 eyaler

@eyaler I also have the same question, do you solve it?

philokey avatar Jan 04 '17 03:01 philokey

Any movement on this?

evolu8 avatar Mar 07 '17 22:03 evolu8

At the moment, is it a 70x70 discriminator as described in the paper?

danmic avatar Mar 15 '17 16:03 danmic

The same question. Does a 4-layer 4-spatial filter 2-strides convolution naturally leads to a 70*70 patch discriminator?

qixiang109 avatar Nov 01 '17 09:11 qixiang109

Here is visualizer to understand how it works: https://fomoro.com/tools/receptive-fields/#

Explained here: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/39

Below is a python script to play around with:

def f(output_size, ksize, stride):
    return (output_size - 1) * stride + ksize

last_layer = f(output_size=1, ksize=4, stride=1)
# Receptive field: 4
fourth_layer = f(output_size=last_layer, ksize=4, stride=1)
# Receptive field: 7
third_layer = f(output_size=fourth_layer, ksize=4, stride=2)
# Receptive field: 16
second_layer = f(output_size=third_layer, ksize=4, stride=2)
# Receptive field: 34
first_layer = f(output_size=second_layer, ksize=4, stride=2)
# Receptive field: 70

print(first_layer)

emilwallner avatar Feb 24 '18 16:02 emilwallner

@emilwallner Hello, I think that in the python code, the comment should be input size rather than receptive field. As that in the visualizer link, where there are input size, output size, and receptive field.

litingfeng avatar May 01 '19 17:05 litingfeng

has anyone found out how to control the patch-size in the discriminator from Nlayerdiscriminator?

taggyhan avatar Dec 09 '22 05:12 taggyhan

Is there any movement?