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

Is it possible to use BART models with non-default samplers? #84

Open
j-adamczyk opened this issue Jun 4, 2023 · 2 comments
Open

Is it possible to use BART models with non-default samplers? #84

j-adamczyk opened this issue Jun 4, 2023 · 2 comments

Comments

@j-adamczyk
Copy link

When I try to train BART with any sampler other than "pymc", I get an error:

ValueError: Model can not be sampled with NUTS alone. Your model is probably not continuous.

This makes sense, since BART is a discrete model. However, does that mean that it is not possible (even theoretically) to e.g. use GPU-enabled samplers like NumPyro? This would be quite worrying, since even extremely tiny bikes example from the docs takes almost a minute on my CPU.

@aloctavodia
Copy link
Member

It is not possible. BART needs a custom sampler.

NumPyro does not have a sampler suitable for BART variables. Actually, a large part of the PyMC-BART code is the sampler that runs on trees. We are working on a faster version of the PGBART sampler at two levels, one is improving the efficiency of the algorithm itself, the other accelerating the Python code using numba and Cython, or even just rewriting it in RUST (see for example https://github.com/elanmart/rust-pgbart, that implements and older version of PyMC-BART in RUST)

@j-adamczyk
Copy link
Author

Ok, this makes sense. So for now I will try other approaches than BART, the current sampler is not particularly feasible for large datasets.

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