Giter VIP home page Giter VIP logo

Comments (2)

patrick-kidger avatar patrick-kidger commented on August 17, 2024 1

I don't think so. (The switching of signs is handled by ForwardSDE/AdjointSDE, not the solver.)

The issue is that AdjointSDE doesn't define a g at all! It only defines g_prod. It turns out for the AdjointSDE that g_prod is efficient to compute whilst g isn't.

Thus the most efficient way of doing things for the forward pass would be to evaluate g once, and then pass it in later, whilst for the backward pass the most efficient thing is just to evaluate g_prod multiple times. We don't yet do this optimisation on the forward pass, but we do the optimised thing on the backward pass.

I think the only solver that is currently a bit inefficient in this way is grad-free Milstein. (Correct me if I've missed one.) Thus I think the neatest way to fix this would be to add an optional g argument to g_prod, which grad-free Milstein uses. Then ForwardSDE.g_prod checks if that argument was passed and evaluates g if not, whilst AdjointSDE.g_prod does an assert that g is None, as grad-free Milstein doesn't work for the adjoint SDE anyway.

from torchsde.

mtsokol avatar mtsokol commented on August 17, 2024

So the main issue to remove re-evaluation of g in those methods by passing already computed g is that for ForwardSDE we need it evaluated with t and for AdjointSDE with -t, right?

from torchsde.

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.