Giter VIP home page Giter VIP logo

Comments (7)

nicodjimenez avatar nicodjimenez commented on July 22, 2024

@evbo I'm almost done writing up a blog post that explains all the backprop equations, hopefully that will clarify everything

from lstm.

nicodjimenez avatar nicodjimenez commented on July 22, 2024

@evbo please read http://nicodjimenez.github.io/2014/08/08/lstm.html which explains what the backprop code does. I will expand the article soon, but it fully addresses your question. Let me know if you find it useful / confusing.

from lstm.

evbo avatar evbo commented on July 22, 2024

Thanks. To help provide some more feedback, here's specifically where I'm still finding myself confused:

Below you multiply by top_diff_h (clearly per chain rule) but I'm not certain why you add top_diff_s?:

# notice that top_diff_s is carried along the constant error carousel
ds = self.state.o * top_diff_h + top_diff_s

You're explanation for recursively summing the loss, and hence recursively summing the derivatives of the loss w.r.t. h(t), makes perfect sense. But why recursively sum the derivative w.r.t. s(t)?

I know s(t) is inherently recursive per the forget gate. Does that have something to do with it? I'm sure the answer must be staring me in the face, but I've been so deeply focused that I'm missing it! Any additional light you can shed is greatly appreciated.

from lstm.

nicodjimenez avatar nicodjimenez commented on July 22, 2024

hi @evbo this is a good question, i've updated the tutorial http://nicodjimenez.github.io/2014/08/08/lstm.html to explain, let me know if this is clear.

from lstm.

evbo avatar evbo commented on July 22, 2024

Great, Now please pardon me for splitting hairs, but see equation 4.14 on page 49 of http://www.cs.toronto.edu/~graves/phd.pdf

I guess I'll never fully know until I derive that equation, but, hand-wavingly, it seems a few terms might be missing from your derivative of Loss w.r.t. s(t) in comparison to Grave's.

from lstm.

nicodjimenez avatar nicodjimenez commented on July 22, 2024

@evbo just because two equations "look" different does not mean they are not the same. my derivation is a relatively rigorous application of the chain rule, if you find a specific mistake in the math please let me know. i know the code is correct because i've done gradient checks, but it's possible there's a typo in the math.

from lstm.

evbo avatar evbo commented on July 22, 2024

Ok, thanks for confirming. One thing that still confused me was how you inferred the first line of your derivation under the "details" section. Is that a special extension of the chain rule for recursive functions? Usually it is just a product of the interior and exterior functions but yours also has a sum.

You give a good reason for the sum in layman's terms, but I was wondering if there was a hidden step in the derivation of that first line.

Thanks! Almost totally 100% on this :)

from lstm.

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.