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

[feature request] one-arg tempered_evaluate #260

Open
miguelbiron opened this issue Dec 11, 2024 · 2 comments
Open

[feature request] one-arg tempered_evaluate #260

miguelbiron opened this issue Dec 11, 2024 · 2 comments

Comments

@miguelbiron
Copy link
Collaborator

Hey @sunxd3 -- we realized that working with flattened_values as state for our samplers is going to result in loss of precision for models with mixed states. For example, when we have ints and floats, flattened_values is concretely typed Vector{Float64} so the ints are cast as floats. And that ends up causing issues when we want to dispatch for coordinate-wise sampling. Therefore, it would be nice to just work with the evaluation_env inside the model as the proper state. But then we don't have a way of computing tempered_evaluate!!(model).

Going further, it seems that (in the long run) it would make your life easier to have a unique "barebones_tempered_evaluate!!" such that all the special cases -- with/without tempering, with/without rng, and with/without flattened values -- are handled via light pre-processing of inputs. Do you think that would be possible?

@sunxd3
Copy link
Member

sunxd3 commented Dec 12, 2024

It makes perfect sense!

In a way AbstractPPL.evaluate!!(model::BUGSModel)does what you suggested, so it is possible to first initialize!(model, param_vector) and then evaluate using the single argument evaluate!!, but like you said, it doesn't a tempered option yet

It's probably time for a refactor now, let me think about it

@miguelbiron
Copy link
Collaborator Author

Awesome!

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

2 participants