Giter Site home page Giter Site logo

Comments (11)

zhibo-liu avatar zhibo-liu commented on July 30, 2024 3

@rosinality
It seems that truncation trick in W space is not used during training:

fake_image = generator(gen_in1, step=step, alpha=alpha)

here's what I got when running pretrained 256px model without truncation :
image
here's with truncation (unchanged generate.py):
image

Apparently, images without truncation are in poor qualities. Why does this happen? Is it because that the pretrained model needs more training? Or we can only generate images using truncation tricks?

Thank you

from style-based-gan-pytorch.

rosinality avatar rosinality commented on July 30, 2024

It is used for style truncation to reduce deviations of styles from calculated mean styles.

from style-based-gan-pytorch.

MichaelMonashev avatar MichaelMonashev commented on July 30, 2024

Did you try code like this:

normal_distribution = torch.distributions.normal.Normal(0.5, 0.1)
input = normal_distribution.sample(sample_shape=(1,512)).clamp(min=0.3, max=0.7)
style = generator.style(input)[0].to(device))

0.1 , 0.3 and 0.7 - parameters for tuning deviations.

from style-based-gan-pytorch.

rosinality avatar rosinality commented on July 30, 2024

I haven't, would it better than truncation on the latent codes from mlp?

from style-based-gan-pytorch.

MichaelMonashev avatar MichaelMonashev commented on July 30, 2024

I correct code above. I suggest it after reading this https://github.com/soumith/ganhacks#3-use-a-spherical-z .

from style-based-gan-pytorch.

MichaelMonashev avatar MichaelMonashev commented on July 30, 2024

The basic idea is to sample from a normal distribution very close to 0.5.

from style-based-gan-pytorch.

rosinality avatar rosinality commented on July 30, 2024

@rentonliu I think longer training will help, as the intuition of the truncation trick is that image quality is poor because of less training in the areas that has low probabilities.

from style-based-gan-pytorch.

rsn870 avatar rsn870 commented on July 30, 2024

Can you please clarify what do you mean by areas that has low proabiliites ?

from style-based-gan-pytorch.

rosinality avatar rosinality commented on July 30, 2024

Some area of noise spaces has relatively lower probability than rest of the spaces. So during training samples from that area will receive less training signals because of less samples came from that area. So quality of samples from that area will be lower than higher probability area. Truncation trick is used for pull samples from these lower probability area to the mean of latent spaces.

from style-based-gan-pytorch.

rsn870 avatar rsn870 commented on July 30, 2024

By noise spaces are you referring to the gaussian noise injected during training or the latent distribution ?

from style-based-gan-pytorch.

rosinality avatar rosinality commented on July 30, 2024

@rsn870 Basically for noise inputs to mlp, but I think latent distributions from mlp also behave similarly.

from style-based-gan-pytorch.

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.