Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractMCMC.step!() is deprecated #63

Open
enguang2 opened this issue Mar 25, 2021 · 3 comments
Open

AbstractMCMC.step!() is deprecated #63

enguang2 opened this issue Mar 25, 2021 · 3 comments

Comments

@enguang2
Copy link

enguang2 commented Mar 25, 2021

Hello, I am just reading https://turing.ml/dev/docs/for-developers/interface and the example there gives step!()
which is no longer used as I believe, and the bundle_samples() is also old and won't work with current AbstractMCMC
Maybe someone can help updating the docs?

@devmotion
Copy link
Member

The documentation of AbstractMCMC in the README should be correct: https://github.com/TuringLang/AbstractMCMC.jl If not, please open an issue or a PR 🙂

Generally, the Turing docs are quite outdated (see TuringLang/TuringTutorials#86 and related issues). One problem is that currently the webpage is reorganized, moved to a separate repository, and the tutorials are ported from Jupyter notebooks to more manageable Julia markdown files. The other more general problem is that often it takes a while for changes to propagate to downstream packages such as Turing. E.g., for AbstractMCMC 2 large parts of Turing (and DynamicPPL) had to be rewritten, and therefore it took several months before Turing started to use the new version of AbstractMCMC. So it is not possible to update the Turing documentation when changes are introduced in the satellite packages if one does not want to confuse Turing users (they would read about something that is not available in Turing yet). So therefore the official documentation for now is the README file.

@bgctw
Copy link

bgctw commented May 5, 2021

@devmotion told that the docu is outdated.
Nevertheless I report problems and potential fixes to hopefully help updating the docu:

I get the following error:
in_support: error in method definition: function Distributions.insupport must be explicitly imported to be extended
One could use a different function name to avoid this conflict with the previously imported Distributions package: e.g. insupport_normal.

The choice of the initial values is unfortunate: a spread parameter of zero is not in the support.
θ_0 = [0.0, 1.0]

The bundle_sample is never called, because the signature does not match:
The current signature in AbstractMCMC is:
bundle_samples(samples, model, sampler, state, chain_type[; kwargs...])

When I call the bundle_samples function then I get the following error:
UndefVarError: Chains not defined
One should add: using MCMCChains

I miss from the Documentation what is the second return value in the current step function.

I would be happy about a continued tutorial, where the same MCMC sampling (instead of or in addition to the Importance Sample) is implemented using Turing.

@enguang2
Copy link
Author

enguang2 commented Jul 7, 2021

@bgctw Been a while from last comment, but I'm recently planning to rewrite the interface guide tutorial and pull request it to Turing website. I also noticed that Chains function missing error. After using MCMCChains, a workaround way is to downgrade the AbstractMCMC package to a much older version(noticed this can be a dangerous action as julia will automatically downgrade all dependents of AbstractMCMC). For julia 1.5, It's fine to use

Pkg.add(Pkg.PackageSpec(;name="AbstractMCMC", version="0.5.3"))

to downgrade it, now the tutorial shall work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants