Tutorials𝞡
We list here a view small examples, that are easy to run locally on a CPU,
to show how to use posteriors
:
Additionally, we provide more in depth examples in the examples directory on GitHub, many of which use larger models that require a GPU to run:
bayes_llama3
: Usesposteriors
andlightning
to train a bayesian ensemble language model Llama-3-8b on the TQA dataset.
continual_lora
: Usesposteriors.laplace.diag_fisher
to avoid catastrophic forgetting in fine-tuning Llama-2-7b on a series of books from the pg19 dataset.
yelp
: Compares a host ofposteriors
methods (highlighting the easy exchangeability) on a sentiment analysis task adapted from the Hugging Face tutorial.
imdb
: Investigates cold posterior effect for a range of approximate Bayesian methods with a CNN-LSTM model on IMDB data, with some interesting takeaways.
continual_regression
: Variational continual learning notebook for a simple regression task that's easy to visualize.
pyro_pima_indians_sghmc
: An accessible notebook demonstrating the use ofposteriors
with apyro
-defined Bayesian logistic regression model, as well as convergence diagnostics frompyro
.