Skip to content

Commit 28e7e24

Browse files
Merge pull request #88 from scikit-learn-contrib/joss-feedback
Joss feedback @mbsuraj
2 parents 19ec4c1 + b21e669 commit 28e7e24

7 files changed

Lines changed: 906 additions & 329 deletions

File tree

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing to bde
2+
3+
Thanks for your interest in improving `bde`. We welcome bug reports,
4+
documentation fixes, examples, tests, and focused code contributions.
5+
6+
Please use GitHub as the default place for project communication:
7+
8+
- Issues: https://github.com/scikit-learn-contrib/bde/issues
9+
- Pull requests: https://github.com/scikit-learn-contrib/bde/pulls
10+
11+
## Contributing changes
12+
13+
For small fixes, open a pull request directly. For larger changes or API changes,
14+
please open an issue first so the approach can be discussed.
15+
16+
Recommended workflow:
17+
18+
1. Fork the repository.
19+
2. Create a branch for your change.
20+
3. Install the development environment as outlined in the README and do not forget to also install the `pre-commit` hooks.
21+
4. Add tests or documentation when relevant.
22+
5. Run the relevant checks (lint,tests).
23+
6. Open a pull request on GitHub and link any related issue.
24+
25+
## Reporting issues
26+
27+
Please report bugs, feature requests, and documentation problems through GitHub
28+
Issues. Before opening a new issue, check whether a similar issue already exists.
29+
30+
For bug reports, include:
31+
32+
- A minimal reproducible example.
33+
- The full traceback or error message.
34+
- Your operating system, Python version, and relevant package versions.
35+
- The expected behavior and the behavior you observed.
36+
37+
## Seeking support
38+
39+
Please use GitHub Issues for usage questions and support requests. This keeps
40+
answers visible to other users and helps the project maintain a searchable record.
41+
42+
Direct email to the maintainers should be reserved for rare cases that are not
43+
appropriate for a public GitHub issue, such as sensitive or private matters.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ pixi run python -m examples.example
6363
Pixi ensures the correct JAX, CUDA (when needed), and scikit-learn versions are
6464
selected automatically. See `pixi.lock` for channel and platform details.
6565

66+
For contributor tooling, use the `dev` Pixi environment. It combines the
67+
documentation, linting, and test environments.
6668

6769

6870
Example Usage

bde/bde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ def __init__(
843843
seed : int, default=0
844844
Shared PRNG seed for member initialisation and sampling.
845845
loss : BaseLoss | None
846-
Custom training loss; defaults to :class:`bde.loss.GaussianNLL`.
846+
Custom training loss; defaults to :class:`bde.loss.CategoricalCrossEntropy`.
847847
activation : str, default='relu'
848848
Activation function applied to each hidden layer.
849849
epochs : int, default=20

bde/loss/loss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def name(self) -> str:
2626

2727
def __call__(self, preds: ArrayLike, y_true: ArrayLike):
2828
mu = preds[..., 0:1]
29-
rmse = (mu - y_true) ** 2
30-
return jnp.mean(rmse)
29+
squared_error = (mu - y_true) ** 2
30+
return jnp.sqrt(jnp.mean(squared_error))
3131

3232

3333
class GaussianNLL(BaseLoss):

paper/paper.bib

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ @inproceedings{sommer2025mile
55
year={2025},
66
}
77

8+
@inproceedings{sommer2026smile,
9+
title = {{Can Microcanonical Langevin Dynamics Leverage Mini-Batch Gradient Noise?}},
10+
author = {Emanuel Sommer and Kangning Diao and Jakob Robnik and Uroš Seljak and David R{\"u}gamer},
11+
booktitle={Forty-third International Conference on Machine Learning},
12+
year={2026},
13+
publisher={PMLR},
14+
}
15+
816
@inproceedings{sommer2024connecting,
917
title={Connecting the Dots: Is Mode-Connectedness the Key to Feasible Sample-Based Inference in Bayesian Neural Networks?},
1018
author={Sommer, Emanuel and Wimmer, Lisa and Papamarkou, Theodore and Bothmann, Ludwig and Bischl, Bernd and R{\"u}gamer, David},
@@ -21,6 +29,38 @@ @InProceedings{papamarkou2024position
2129
publisher = {PMLR}
2230
}
2331

32+
@article{pymc2023,
33+
title = {{PyMC}: A Modern and Comprehensive Probabilistic Programming Framework in {P}ython},
34+
author = {Oriol Abril-Pla and Virgile Andreani and Colin Carroll and Larry Dong and Christopher J. Fonnesbeck and Maxim Kochurov and Ravin Kumar and Junpeng Lao and Christian C. Luhmann and Osvaldo A. Martin and Michael Osthege and Ricardo Vieira and Thomas Wiecki and Robert Zinkov },
35+
journal = {{PeerJ} Computer Science},
36+
volume = {9},
37+
number = {e1516},
38+
doi = {10.7717/peerj-cs.1516},
39+
year = {2023}
40+
}
41+
42+
@article{phan2019numpyro,
43+
title={Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro},
44+
author={Phan, Du and Pradhan, Neeraj and Jankowiak, Martin},
45+
journal={arXiv preprint arXiv:1912.11554},
46+
year={2019}
47+
}
48+
@inproceedings{daxberger2021laplace,
49+
title = {Laplace {{Redux}} {\textendash} {{Effortless Bayesian Deep Learning}}},
50+
booktitle = {35th {{Conference}} on {{Neural Information Processing Systems}} ({{NeurIPS}} 2021)},
51+
author = {Daxberger, Erik and Kristiadi, Agustinus and Immer, Alexander and Eschenhagen, Runa and Bauer, Matthias and Hennig, Philipp},
52+
year = {2021},
53+
keywords = {approximate\_inference,bnn,gaussian\_posterior,laplace,last\_layer,uncertainty\_quantification}
54+
}
55+
56+
@inproceedings{
57+
duffield2025scalable,
58+
title={Scalable Bayesian Learning with posteriors},
59+
author={Samuel Duffield and Kaelan Donatella and Johnathan Chiu and Phoebe Klett and Daniel Simpson},
60+
booktitle={The Thirteenth International Conference on Learning Representations},
61+
year={2025}
62+
}
63+
2464
@misc{cabezas2024blackjax,
2565
title={{BlackJAX: Composable Bayesian inference in JAX}},
2666
author={Alberto Cabezas and Adrien Corenflos and Junpeng Lao and Rémi Louf},
@@ -92,4 +132,3 @@ @misc{misc_bike_sharing_dataset_275
92132
year = {2013},
93133
howpublished = {UCI Machine Learning Repository}
94134
}
95-

paper/paper.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ The workflow of `bde` implements the two-stage BDE inference process of MILE. Fi
4747
# Software design
4848

4949
Because optimization and sampling across ensemble members are independent, `bde` exploits JAX’s parallelization and just-in-time compilation to scale efficiently across CPUs, GPUs, and TPUs. Given new test data, the package approximates the posterior predictive, enabling point predictions, credible intervals, coverage estimates, and other uncertainty metrics through a unified interface.
50+
Further, this work currently targets the well-studied and empirically validated full-batch, fully connected-network setting for tabular data also studied in MILE [@sommer2025mile]. This makes it particularly suitable for the chosen scikit-learn framework. Stochastic-gradient variants such as SMILE [@sommer2026smile] require different algorithmic and software design choices, yet will be considered for future extensions.
5051

5152
# State of the field
5253

53-
Reliable uncertainty quantification (UQ) is increasingly viewed as a critical component of modern machine learning systems, and BDL provides a principled framework for achieving it [@papamarkou2024position]. While several libraries support optimization-based approaches such as variational inference or classical Bayesian modeling, accessible tools for sampling-based inference in Bayesian neural networks remain scarce. Existing probabilistic programming frameworks offer MCMC but require substantial manual configuration to achieve competitive performance on neural network models.
54+
Reliable uncertainty quantification (UQ) is increasingly viewed as a critical component of modern machine learning systems, and BDL provides a principled framework for achieving it [@papamarkou2024position]. While several libraries support optimization-based approaches such as variational inference [@duffield2025scalable], Laplace approximations [@daxberger2021laplace], or classical Bayesian modeling [@pymc2023], accessible tools for sampling-based inference in Bayesian neural networks remain scarce. Existing probabilistic programming and inference frameworks such as NumPyro [@phan2019numpyro] and `blackjax` [@cabezas2024blackjax] offer MCMC building blocks but require substantial manual configuration to achieve competitive Bayesian neural-network workflows.
5455

5556
# Statement of need
5657

@@ -97,7 +98,7 @@ Classification follows analogously using `BdeClassifier`.
9798

9899
# Regression benchmark
99100

100-
We provide a small benchmark of `bde` on the `airfoil` [@Dua_2019] and the `bikesharing` [@misc_bike_sharing_dataset_275] datasets. We report mean predictive performance (RMSE), UQ metrics (NLL in the distributional and mean regression formulation), reported as mean ± standard deviation over 5 independent runs. The results show competitive out-of-the-box performance of BDE especially in UQ with its native distributional regression capability.
101+
We provide a small benchmark of `bde` on the `airfoil` [@Dua_2019] and the `bikesharing` [@misc_bike_sharing_dataset_275] datasets. We report mean predictive performance (RMSE), UQ metrics (NLL in the distributional and mean regression formulation), reported as mean ± standard deviation over 5 independent model seeds and fixed train/test splits. The results show competitive out-of-the-box performance of BDE especially in UQ with its native distributional regression capability.
101102

102103
| `airfoil` | RMSE | NLL (distr. regr.) | NLL (mean regr.) |
103104
| ------------- | ------------------- | -------------------- | -------------------- |

0 commit comments

Comments
 (0)