Giter VIP home page Giter VIP logo

Comments (4)

rrmina avatar rrmina commented on May 31, 2024

Hi @UtopiaHu,

Thanks for the question. Actually it doesn't matter whether you do the former or you do the latter. MSE stands for Mean Square of Error aka Mean of Square of Differences. The square of (generated - content) should be equal to the square of (content - generated).

from fast-neural-style-pytorch.

UtopiaHu avatar UtopiaHu commented on May 31, 2024

Hi, @rrmina ,
Thank you for your reply.

The former will raise the following error:
AssertionError: nn criterions don't compute the gradient w.r.t. targets - please mark these tensors as not requiring gradients.
My pytorch version is 0.4.0.

from fast-neural-style-pytorch.

rrmina avatar rrmina commented on May 31, 2024

@UtopiaHu

I see. I do not recall having that problem in versions 0.4.1 and 1.0.1. Seeing now the assertion error, you might be right. Technically they should be equal but by convention, the latter is the correct one.

Thanks for reporting. I'll update the codes to reflect the suggested changes. :)

from fast-neural-style-pytorch.

UtopiaHu avatar UtopiaHu commented on May 31, 2024

Hi, I have another question.
When initializing the VGG network, all the parameters are set to have the attributes of requries_grad=false, which means the gradients of VGG losses with respect to the VGG parameters will not be calculated after the backward() function is called, according to my understand. Then, how do the VGG losses propagate back to the output and the intermediate layers of the transformer net? I think if we want to update the transformer net, the VGG losses should go backward to update the parameters. Maybe I missed something about how pytorch works.
Thanks! :-)

from fast-neural-style-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.