GithubHelp home page GithubHelp logo

Comments (4)

yuuho avatar yuuho commented on June 27, 2024

My implementation also does activation.

For some reason they don't mention it in the paper, but in their implementation they do a process called gain. Gain is simply the process of multiplying the feature map by sqrt (2).
And my understanding is that the implementation is:

  • StyleGAN1: LeakyReLU( conv(feature)*(2**0.5) + noise + bias )
  • StyleGAN2: LeakyReLU( ( conv(feature) + noise + bias )*(2**0.5) )

I don't know the detailed effect of this process...

I've written it in nn.Sequential so the source code comparison can show this difference.
For this reason, I decomposed bias and act into separate nn.Modules.

'Fconv8' : [ ['EqConv3x3',512, 512], ['amp'], ['noiseE',512, 8], ['bias',512], ['Lrelu'] ], 'adain8b' : [['adain',512]], 'toRGB_8' : [['EqConv1x1',512, 3], ['bias',3]],

'Fconv8' : [['EqModConv3x3', 512, 512], ['noiseP', 8], ['bias',512], ['amp'], ['Lrelu'] ], 'toRGB_8' : [['EqModConv1x1',512, 3], ['bias',3]],

from stylegans-pytorch.

Johnson-yue avatar Johnson-yue commented on June 27, 2024

Thank you for such detailed explanation。 But I think there are some question here
I think the orig implementation is:

  • StyleGAN2 : LeakyReLU( ( conv(feature) + noise + bias ) ) *(2**0.5) this is different from

yours:

  • StyleGAN2 : LeakyReLU( ( conv(feature) + noise + bias ) *(2**0.5))

the difference is position of Gain !!
orig: ModConv2d -> add noise -> add bias -> lrelu -> multiply Gain
yours : ModConv2d -> add noise -> add bias -> multiply Gain -> relu

Although they are numerically equal

from stylegans-pytorch.

Johnson-yue avatar Johnson-yue commented on June 27, 2024

And I meaning your toRGB_* only bias and not have activation
I think it should be:
'toRGB_8' : [['EqModConv1x1',512, 3], ['bias',3], ['Lrelu'], ['amp']],

from stylegans-pytorch.

Johnson-yue avatar Johnson-yue commented on June 27, 2024

Sorry it is my mistake, you are right

from stylegans-pytorch.

Related Issues (5)

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.