Comments (7)
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.
@sethaxen That sounds great. For models with lots of parameters this will be super handy.
from pathfinder.jl.
@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.
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.
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.
Got it - thanks so much!
from pathfinder.jl.
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)
- Supporting inputs implementing the LogDensityProblems interface
- Fixing type-noninferrability from Optimization.solve HOT 1
- Using Optimization.MaxSense HOT 1
- Multi-threaded multi-path Pathfinder broken with recent Transducers versions HOT 4
- Support alternative ways of choosing normal approximations HOT 2
- More-Thuente line search fails for posterior
- TagBot trigger issue HOT 57
- Return all intermediates in a custom struct HOT 1
- Drop StatsFuns as a dependency
- Turing integration HOT 1
- Load time is doubled on the latest Julia beta
- Options for approximation? HOT 2
- Switching to Hager-Zhang line search HOT 1
- Making Optimization (formerly GalacticOptim) optional HOT 5
- multipathfinder - no method matching iterate HOT 6
- WoodburyPDMat and unwhitening and square norms HOT 2
- Making subpackages for compatibility with HMC packages HOT 1
- NaNs introduced with 3 posteriordb models HOT 9
- Benchmark with posteriordb models HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathfinder.jl.