Coder Social home page Coder Social logo

Comments (9)

yebai avatar yebai commented on September 26, 2024

@sethaxen any thoughts on how to design this API better?

from advancedhmc.jl.

yebai avatar yebai commented on September 26, 2024

cc @devmotion

from advancedhmc.jl.

torfjelde avatar torfjelde commented on September 26, 2024

But that interface is supported, no? After #301 ?

from advancedhmc.jl.

yebai avatar yebai commented on September 26, 2024

I think we still need to explicitly construct the Hamiltonian type or LogDensityModel type and pass it to the sample function. Some cosmetic changes are needed in the abstractmcmc interface implementation to support an intuitive interface like the one in TuringLang/AdvancedMH.jl#76.

from advancedhmc.jl.

torfjelde avatar torfjelde commented on September 26, 2024

I think we still need to explicitly construct the Hamiltonian type and pass it to the sample function

Nah, you can just construct the HMCSampler and pass that it:)

from advancedhmc.jl.

sethaxen avatar sethaxen commented on September 26, 2024

I think we still need to explicitly construct the Hamiltonian type and pass it to the sample function

Nah, you can just construct the HMCSampler and pass that it:)

@torfjelde can you give an example of what you mean?

In my view a user should be able to entirely configure the warm-up period and sampling period without requiring they specify initializations for step size, metric, and initial point, but allowing for the possibility that they specialize the initializations.

It should also be really easy to configure the warm-up phase(s). e.g. it should be possible to make initial step size selection part of the warm-up phase. It should be possible to initialize the sampling with a metric of one type but then adapt a different type of metric.

Maybe some of these are already possible. If so, awesome! It would be handy to document such cases. If it becomes possible to use Turing models directly with the sampler without needing to define a new sampler as Turing does, that would be amazing!

from advancedhmc.jl.

yebai avatar yebai commented on September 26, 2024

use Turing models directly with the sampler without needing to define a new sampler as Turing does, that would be amazing!

That's one nice goal for Turing (a by-product of the goal we want thoroughly decouple model specification and inference). We are very close to that point!

from advancedhmc.jl.

yebai avatar yebai commented on September 26, 2024

I looked at DynamicHMC's interface mcmc_with_warmup and mcmc_keep_warmup. What we need to include here is merely a well-documented user-facing API.

@devmotion, maybe we can make the AbstractMCMC.sample interface more intuitive so users can have a nice way to specify adaption, initialisation, algorithm choice etc. It seems Julia people love NamedTuple more than verbose arguments...

from advancedhmc.jl.

devmotion avatar devmotion commented on September 26, 2024

maybe we can make the AbstractMCMC.sample interface more intuitive so users can have a nice way to specify adaption, initialisation, algorithm choice etc. It seems Julia people love NamedTuple more than verbose arguments...

AbstractMCMC does not restrict how samplers want their options to be specified, it only adds some standard options such as discard_initial, thinning, and progress: https://turinglang.org/AbstractMCMC.jl/dev/api/#Common-keyword-arguments It's completely up to downstream packages if they want to support these, if they want to add more options (often the case, I assume), and if they want to nest options as named tuples. So I think specifying/changing options in AdvancedHMC does not (necessarily) require any changes in AbstractMCMC.

Generally, I think there's not a single design choice that's used everywhere in the ecosystem. SciML (in most places) uses a large set of (non-nested) keyword arguments, DynamicHMC nests some options in NamedTuple (I guess this might be useful mostly in cases where you have some hierarchy of options), and Optim supports options as Optim.Options.

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