From 1b0c9e1a797f9ab2cdc6abb989d5077409b3cfc7 Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:04:05 +0000 Subject: [PATCH 1/6] update to 0.2.0, update references, unpin polyagamma --- docs/source/getting_started.rst | 23 ++++++++++++++--------- millipede/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 3542dba..7882b0a 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -142,7 +142,7 @@ Martin Jankowiak: martin@basis.ai References ---------- -* Jankowiak, M., 2022. `Bayesian Variable Selection in a Million Dimensions `__ arXiv preprint arXiv:2208.01180. +* Jankowiak, M., 2023. `Bayesian Variable Selection in a Million Dimensions `__ AISTATS 2023. * Zanella, G. and Roberts, G., 2019. `Scalable importance tempering and Bayesian variable selection `__. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 81(3), pp.489-517. @@ -153,12 +153,17 @@ If you use millipede please consider citing: :: -@article{jankowiak2022bayesian, - title={Bayesian Variable Selection in a Million Dimensions}, - author={Martin Jankowiak}, - journal={arXiv preprint arXiv:{2208.01180}, - year={2022}, - eprint={2208.01180}, - archivePrefix={arXiv}, - primaryClass={stat.ME} +@InProceedings{pmlr-v206-jankowiak23a, + title = {Bayesian Variable Selection in a Million Dimensions}, + author = {Jankowiak, Martin}, + booktitle = {Proceedings of The 26th International Conference on Artificial Intelligence and Statistics}, + pages = {253--282}, + year = {2023}, + volume = {206}, + series = {Proceedings of Machine Learning Research}, + month = {25--27 Apr}, + publisher = {PMLR}, + pdf = {https://proceedings.mlr.press/v206/jankowiak23a/jankowiak23a.pdf}, + url = {https://proceedings.mlr.press/v206/jankowiak23a.html}, } + diff --git a/millipede/__init__.py b/millipede/__init__.py index 310fb40..b869c41 100644 --- a/millipede/__init__.py +++ b/millipede/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.1.0" +__version__ = "0.2.0" from millipede.binomial import CountLikelihoodSampler from millipede.normal import NormalLikelihoodSampler diff --git a/setup.py b/setup.py index e7bdc8a..5276911 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ install_requires=[ "torch>=1.11", "pandas", - "polyagamma==1.3.2", + "polyagamma", "tqdm", ], extras_require={ From c8fb8a2d97b8b94267dab868f02d468591055e69 Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:09:47 +0000 Subject: [PATCH 2/6] update CI to py39 and torch251 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ac076f..b5a852f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -38,7 +38,7 @@ jobs: needs: lint strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -51,7 +51,7 @@ jobs: sudo apt-get update sudo apt-get install gcc-8 g++-8 ninja-build python -m pip install --upgrade pip wheel setuptools - pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install torch==2.5.1+cpu -f https://download.pytorch.org/whl/torch_stable.html pip install .[test] pip install coveralls pip freeze From 105cae82a40b2e8db6b1df8c1197871ee68dd828 Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:12:32 +0000 Subject: [PATCH 3/6] torch==2.3.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5a852f..0f0a050 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: sudo apt-get update sudo apt-get install gcc-8 g++-8 ninja-build python -m pip install --upgrade pip wheel setuptools - pip install torch==2.5.1+cpu -f https://download.pytorch.org/whl/torch_stable.html + pip install torch==2.3.1+cpu -f https://download.pytorch.org/whl/torch_stable.html pip install .[test] pip install coveralls pip freeze From dab79549e0f3d941cac27ed0c38ad189c321b45b Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:18:53 +0000 Subject: [PATCH 4/6] upper=False --- millipede/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/millipede/util.py b/millipede/util.py index e6a8e62..a0bc76b 100644 --- a/millipede/util.py +++ b/millipede/util.py @@ -20,7 +20,7 @@ def safe_cholesky(A, epsilon=1.0e-8): if A.shape == (1, 1): return A.sqrt() try: - return torch.linalg.cholesky(A) + return torch.linalg.cholesky(A, upper=False) except RuntimeError as e: Aprime = A.clone() jitter_prev = 0.0 @@ -29,7 +29,7 @@ def safe_cholesky(A, epsilon=1.0e-8): Aprime.diagonal(dim1=-2, dim2=-1).add_(jitter_new - jitter_prev) jitter_prev = jitter_new try: - return torch.linalg.cholesky(Aprime) + return torch.linalg.cholesky(Aprime, upper=False) except RuntimeError: continue raise e From 3d9aea243fa56dfedd4d6455364ac16a66d014ca Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:21:48 +0000 Subject: [PATCH 5/6] more steps in test --- tests/test_count_samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_count_samplers.py b/tests/test_count_samplers.py index c5c082c..75bd51e 100644 --- a/tests/test_count_samplers.py +++ b/tests/test_count_samplers.py @@ -15,7 +15,7 @@ @pytest.mark.parametrize("subset_size", [12, None]) @pytest.mark.parametrize("variable_S", [False, True]) -def test_binomial(subset_size, variable_S, streaming=False, N=512, P=16, T=2000, T_burnin=200, intercept=0.17, seed=1): +def test_binomial(subset_size, variable_S, streaming=False, N=512, P=16, T=3000, T_burnin=500, intercept=0.17, seed=1): torch.manual_seed(seed) X = torch.randn(N, P).double() X_assumed = torch.randn(N, 2).double() From ec2467ddc6e3a4bdf820da97fa678fe01894c797 Mon Sep 17 00:00:00 2001 From: Martin Jankowiak Date: Thu, 23 Jan 2025 23:34:05 +0000 Subject: [PATCH 6/6] fewer steps --- tests/test_count_samplers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_count_samplers.py b/tests/test_count_samplers.py index 75bd51e..8e464fd 100644 --- a/tests/test_count_samplers.py +++ b/tests/test_count_samplers.py @@ -15,7 +15,7 @@ @pytest.mark.parametrize("subset_size", [12, None]) @pytest.mark.parametrize("variable_S", [False, True]) -def test_binomial(subset_size, variable_S, streaming=False, N=512, P=16, T=3000, T_burnin=500, intercept=0.17, seed=1): +def test_binomial(subset_size, variable_S, streaming=False, N=512, P=16, T=2000, T_burnin=500, intercept=0.17, seed=1): torch.manual_seed(seed) X = torch.randn(N, P).double() X_assumed = torch.randn(N, 2).double()