Giter VIP home page Giter VIP logo

Comments (6)

torfjelde avatar torfjelde commented on June 12, 2024 2

I agree with changing it, as I initially got quite confused by the name myself. What confused me was the fact that the logpdf_with_trans is computing the logpdf of the transformed variable using the non-transformed one. From both the current name and the one suggested by @willtebbutt I immediately think it's actually doing logpdf(d, invlink(d, y)) + logabsdetjac(invlink, y) rather than logpdf(d, x) - logabsdetjac(link, x), where y is the transformed variable and x = rand(d), if that makes sense. It's of course the same result, but what's the expected input was kind of confusing to me.

With that being said, I realize such changing the internals of the methods might be a bit drastic given other packages' dependence on Bijectors.jl. So in that case, I think I prefer logpdf_with_jac or logpdf_with_jacobian, as it doesn't give such a strong indication that the expected input is the transformed variable when it isn't.

Worth noting that I already introduced logpdf_with_jac in the recent interface PR, which returns a tuple (logpdf_with_trans, logjac). But we also recently introduced a forward(d::Distribution) which kind of replaces logpdf_with_jac and is more useful, so we could easily drop that method and use the name for this purpose instead.

from bijectors.jl.

willtebbutt avatar willtebbutt commented on June 12, 2024

Perhaps logpdf_of_trans? i.e. the logpdf of the transformed random variable?

from bijectors.jl.

yebai avatar yebai commented on June 12, 2024

That sounds good too.

from bijectors.jl.

yebai avatar yebai commented on June 12, 2024

@xukai92 @torfjelde Does Will's proposal make sense to you?

from bijectors.jl.

xukai92 avatar xukai92 commented on June 12, 2024

I prefer logpdf_with_jac.

Also compared with forward, logpdf_with_jac is more verbose - when people reads the code they at least know it's doing something about computing the log density with some Jacobian computation invovled.

from bijectors.jl.

yebai avatar yebai commented on June 12, 2024

logpdf_with_jac looks good to me!

from bijectors.jl.

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.