GithubHelp home page GithubHelp logo

Comments (3)

dtolpin avatar dtolpin commented on June 26, 2024

I looked at the code of dippl and the original paper. This reminded me that there is an issue with the addressing scheme there: different checkpoints may have the same address in the same stack location:

(fn [x]
  (let [foo (fn [x] (sample (normal 0 x))
         bar (fn [x] (sample (normal x 1))
         fun (if (> x 1) foo bar)]
     (fun x))

both sample statements will get the same address when invoked. However they should not be reused. Same about observe.

Of course, the current addressing scheme can also be fooled by passing different distributions as parameters to sample:

(fn [x]
   (sample (if (> x 1) (normal 0 x) (normal x 1))))

(which will not work well with LI scheme anyway). However, there is a different level of ambiguity here, much more obvious to the model writer than in the above example. A solution for that would be to combine structural information AND a unique identifier (allocated deterministically) for each sample. Of course, these are edge cases, but software is judged by edge cases --- rare failures bear a high regret.

from anglican-infcomp.

lezcano avatar lezcano commented on June 26, 2024

I don't know the details of the particular implementation, but you might want to implement something similar to the behaviour of the addresses generated with backtracehttp://man7.org/linux/man-pages/man3/backtrace.3.html. Backtrace uses (not quite, but almost) the offsets of the function calls with respect to the function entry point in the compiled code. I think that this would solve this problem.

from anglican-infcomp.

dtolpin avatar dtolpin commented on June 26, 2024

That's perfect for a language like C++ but not for a functional language. In a functional language functions (actually, closures) are computed on the fly rather than compiled'. So the same function' may close on different environments, and this is exactly the reason why lightweight transformation addressing is easy to fool in a functional language.

from anglican-infcomp.

Related Issues (1)

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.