Giter Club home page Giter Club logo

Comments (4)

eriklindernoren avatar eriklindernoren commented on July 27, 2024 5

Hi,

  1. If you print the shape of the output of the last downsample layer in the generator you will see that the output has the shape (?, 2, 2, 512). You can do this by adding print (d7.shape) in Pix2Pix.build_generator. By setting padding='same' padding will be applied to preserve the spatial resolution of the input given that strides=1. If you use the same setting for padding and set strides=2 padding will be applied in the same way as in the previous case, but as stride is set to 2 the spatial resolution of the output is downsampled by a factor of two.

  2. As the input image is propogated through four downsample layers the output shape of the discriminator will be (batch_size, img_height // 2**4, img_width // 2**4, 1) = (batch_size, 256 // 2**4, 256 // 2**4, 1) = (batch_size, 16, 16, 1).

from keras-gan.

pGit1 avatar pGit1 commented on July 27, 2024

Thanks for these answers!!

  1. All these years I've thought "same" was ensuring spatial resolution regardless of stride by automatically padding the the input feature maps with zeros...

But I just checked deeper and you are absolutely right "same" is ONLY maintains spatial when stride=1. Since I always use stride equals one, i was confused! Thanks for clarifying this...

  1. Your answer to number one answers this question of mine as well...

Thanks so much!!!!!!!

from keras-gan.

eriklindernoren avatar eriklindernoren commented on July 27, 2024

Awesome. No problem!

from keras-gan.

pGit1 avatar pGit1 commented on July 27, 2024

I think I answered my own question about the Patch GAN idea by the way. Is the idea that rather than just letting D output a single number for the entire image as in the traditional sense, you instead force smaller sub patches of the image to be "believable" by D and as a result produce higher quality images from G. This seems to make a lot of sense to me. What is your recommendation for tuning the ouptut spatial resolution of D, is higher better or worse?

It looks like you make use of MSE losses as well is this due to the insights from Least Squares GANs paper (which I thought was fantastic by the way)? I agree with your choice of loss functions just wondering what your rationale is...

THIS CODE IS AMAZING and thanks to your efforts I think I have a 90%+ understanding of what is going with pix2pix.

Concerning this Mode Collapse we always observe is there anything explicit in the code that I am missing that explicitly combats that? Ive heard of this term "mean distance between batch" but I dont know if that actually works well in practice.

Im closing this now but I would love your thoughts still!!

THANKS AGAIN!!!!!!!!!!!!!

EDIT: Just noticed you closed this already.

from keras-gan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.