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

Default target_accept not mentioned anywhere in the docs #7455

Open
ricardoV94 opened this issue Aug 12, 2024 · 15 comments
Open

Default target_accept not mentioned anywhere in the docs #7455

ricardoV94 opened this issue Aug 12, 2024 · 15 comments
Labels

Comments

@ricardoV94
Copy link
Member

Description

...

@kdotmanoj
Copy link
Contributor

can you provide more info about this?

@ricardoV94
Copy link
Member Author

can you provide more info about this?

I think it's pretty self explanatory.

@ricardoV94
Copy link
Member Author

It's a keyword argument to pm.sample

@kdotmanoj
Copy link
Contributor

so the value is 0.8 right, found here:

image

i am finding it difficult to find where to edit as it is autogenerated from the code.

@ricardoV94
Copy link
Member Author

so the value is 0.8 right, found here:

image

i am finding it difficult to find where to edit as it is autogenerated from the code.

You're looking at nutpie sample function not pymc

@cluhmann
Copy link
Member

Is target_accept a kwarg to pm.sample() or just another **kwargs? The argument isn't even included in the API docs, so if it's the former, there's a bigger problem.

I mean, it's detailed here, but I assumed that the sampling defaults would be specified deeper in the code, possibly allowing for different default for different sampling algorithms.

@Armavica
Copy link
Member

There are at least a couple places where a default is provided deep in the code:

target_accept=kwargs.pop("nuts", {}).get("target_accept", 0.8),

target_accept: float = 0.8,

kwargs.setdefault("target_accept", 0.65)

target_accept=0.8,

@cluhmann
Copy link
Member

Exactly. But those are each specified separately and, it turns out, in a way that creates different defaults for different algorithms. So I'm not sure what's missing from the docs.

@ricardoV94
Copy link
Member Author

Exactly. But those are each specified separately and, it turns out, in a way that creates different defaults for different algorithms. So I'm not sure what's missing from the docs.

I couldn't figure out what the default is as an advanced user. Since it's common advice to increase it (even automatic in case of divergences) it should be easy to find what the default is.

@cluhmann
Copy link
Member

This is caused by pm.sample() being a franken-wrapper that dispatches to a bunch of actual sampling methods, but seems like it does something useful all on its own. Where would you expect the default value to be documented?

@ricardoV94
Copy link
Member Author

pm.sample 🤷‍♂️🫠🥹? Or do you have a better idea?

@cluhmann
Copy link
Member

cluhmann commented Aug 16, 2024

But ... it's not an argument to pm.sample(). I do have a better idea, but you didn't like it (e.g., deprecate pm.sample). 😂

@ricardoV94
Copy link
Member Author

But ... it's not an argument to pm.sample(). I do have a better idea, but you didn't like it (e.g., deprecate pm.sample). 😂

It is, just hidden inside **kwargs.

It's actually a special kwarg, the only one we accept both directly and as usual step kwargs

@ricardoV94
Copy link
Member Author

ricardoV94 commented Aug 16, 2024

See #5622

@kdotmanoj
Copy link
Contributor

kdotmanoj commented Aug 16, 2024

@ricardoV94 do you suggest mentioning the default values of target_accept here ?

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

No branches or pull requests

4 participants