Giter VIP home page Giter VIP logo

Comments (7)

sethaxen avatar sethaxen commented on June 8, 2024 2

Thanks @SamuelBrand1 for the bump! It seems LogDensityProblemsAD and Turing (as well as Optimization.jl) now use the ADTypes interface for specifying AD, so that's a good reason to adopt this as a keyword, both when calling Pathfinder on a Turing model but also when a user passes a LogDensityProblem.

from pathfinder.jl.

SamuelBrand1 avatar SamuelBrand1 commented on June 8, 2024 1

@sethaxen That sounds great. For models with lots of parameters this will be super handy.

from pathfinder.jl.

sethaxen avatar sethaxen commented on June 8, 2024 1

@SamuelBrand1 #178 adds an adtype keyword to pathfinder and multipathfinder for use for Turing models, LogDensityProblems, and log-density functions. Still need to update the docstrings and add a few more tests, but would you like to test it out and make sure it works fine for your models?

from pathfinder.jl.

SamuelBrand1 avatar SamuelBrand1 commented on June 8, 2024 1

Thanks @sethaxen !

I'm currently working on Epi inference project/package-to-be with @seabbs and @zsusswein so this is a good chance to try it out.

from pathfinder.jl.

sethaxen avatar sethaxen commented on June 8, 2024

Does Pathfinder interact with the AD backend chosen in Turing, ie.., Turing.setadbackend ?

Good question! We use Turing's implementation of either optim_function or optim_problem (both are exported but not yet documented). The code for these seems somewhat complicated, but I don't think it uses Turing's AD backend. Instead, they seem to use Optimization.jl's own AD backend machinery. So in the Turing example, to use ReverseDiff, this should work:

using ReverseDiff, Optimization
fun = optim_function(model, MAP(); constrained=false, autoad=Optimization.AutoReverseDiff())
dim = length(fun.init())
pathfinder(fun.func; dim)

Currently there's not a way to call pathfinder(model; autoad), but that's a kwarg we could certainly add support for.

In addition to Turing's Optimization.jl integration, it has specifically Optim.jl integration for its mode estimation functionality, and this seems to use Turing's own AD backend. We could explore using this machinery when an Optim.jl optimizer is selected (which is the default, LBFGS, and the only non-experimental choice).

Thanks for developing Pathfinder.jl ! Great to have Pathfinder in the Julia ecosystem.

You're welcome!

from pathfinder.jl.

weinstockj avatar weinstockj commented on June 8, 2024

Got it - thanks so much!

from pathfinder.jl.

SamuelBrand1 avatar SamuelBrand1 commented on June 8, 2024

I also want to say thanks for creating Pathfinder!

Just want to bump this, because as of (I think) last month Turing seems to have made it easier to interface with an AD choice.

For example, optim_problem now takes an adtype argument. This is where the PathfinderTuringExt interfaces with Turing I think here.

So now I think you can just add an adtype kwarg to give to optim_problem in pathfinder(mdl::Model,...).

from pathfinder.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.