Git Product home page Git Product logo

Comments (4)

phizaz avatar phizaz commented on August 11, 2024 1

Can you please point to the line of the code in question?

from diffae.

phizaz avatar phizaz commented on August 11, 2024 1

I believe the line 403-416 was not used in DiffAE at all, and hence not related to DiffAE. It was a legacy code from the base repo that we built upon.

Regarding your second question, 0.3*sqrt(512). 0.3 is definitely tuned by hand based on qualitative results. sqrt(512) is related to the fact that F.normalize(cls_model.classifier.weight[cls_id][None, :], dim=1) is a unit vector (which is rather small, and depends on the number of dims). It's nice to have something that scales with dims (make the coefficient more robust). I think a Gaussian random vector with 512 dimensions has the norm of sqrt(512), multiplying a unit vector with sqrt(512) scales it as though it has the same size as a random Gaussian vector.

from diffae.

cyuting940612 avatar cyuting940612 commented on August 11, 2024

Thanks for your reply.

Yes of course. The condition_mean method is Line 403-416 in base.py

Also in the manipulate case:

cond2 = cond2 + 0.3 * math.sqrt(512) * F.normalize(cls_model.classifier.weight[cls_id][None, :], dim=1)

could you please share how you determine the coefficient (0.3*sqrt(512))?

Thanks for your help!

from diffae.

cyuting940612 avatar cyuting940612 commented on August 11, 2024

Really appreciate your reply.

But I think line 403-416 actually used in img = model.render(xT, cond2, T=100) from block[33] of manipulate.ipynb.

In which the render method can be conditioned based on cond_fn. But I don't find anywhere cond_fn be defined.

So could you please provide me some clue on how to implement this conditional render?

Thank you!

from diffae.

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.