Skip to content

Commit 2588fc4

Browse files
lukmazThe Meridian Authors
authored and
The Meridian Authors
committed
Randomize seed between chain batches.
PiperOrigin-RevId: 738504856
1 parent e2c3ace commit 2588fc4

File tree

6 files changed

+22
-12
lines changed

6 files changed

+22
-12
lines changed

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):
2323

2424
## [Unreleased]
2525

26+
## [1.0.7] - 2025-03-19
27+
28+
* Bump tensorflow to 2.18.
29+
* Bump tensorflow-probability to 0.25.
30+
* Bump numpy to 2.0.2.
31+
* Bump pandas to 2.2.2.
32+
* Bump scipy to 1.13.1.
33+
2634
## [1.0.6] - 2025-03-18
2735

2836
* Fix issue #548: Make time coordinate regularity check less stringent.
@@ -235,4 +243,5 @@ To release a new version (e.g. from `1.0.0` -> `2.0.0`):
235243
[1.0.4]: https://github.com/google/meridian/releases/tag/v1.0.4
236244
[1.0.5]: https://github.com/google/meridian/releases/tag/v1.0.5
237245
[1.0.6]: https://github.com/google/meridian/releases/tag/v1.0.6
238-
[Unreleased]: https://github.com/google/meridian/compare/v1.0.6...HEAD
246+
[1.0.7]: https://github.com/google/meridian/releases/tag/v1.0.7
247+
[Unreleased]: https://github.com/google/meridian/compare/v1.0.7...HEAD

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ To cite this repository:
151151
author = {Google Meridian Marketing Mix Modeling Team},
152152
title = {Meridian: Marketing Mix Modeling},
153153
url = {https://github.com/google/meridian},
154-
version = {1.0.6},
154+
version = {1.0.7},
155155
year = {2025},
156156
}
157157
```

demo/Meridian_Getting_Started.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"source": [
336336
"%%time\n",
337337
"mmm.sample_prior(500)\n",
338-
"mmm.sample_posterior(n_chains=7, n_adapt=500, n_burnin=500, n_keep=1000)"
338+
"mmm.sample_posterior(n_chains=7, n_adapt=500, n_burnin=500, n_keep=1000, seed=1)"
339339
]
340340
},
341341
{

meridian/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"""Meridian API."""
1616

17-
__version__ = "1.0.6"
17+
__version__ = "1.0.7"
1818

1919

2020
from meridian import analysis

meridian/model/posterior_sampler.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def __call__(
457457
[ResourceExhaustedError when running Meridian.sample_posterior]
458458
(https://developers.google.com/meridian/docs/advanced-modeling/model-debugging#gpu-oom-error).
459459
"""
460-
seed = tfp.random.sanitize_seed(seed) if seed else None
460+
seed = tfp.random.sanitize_seed(seed or 0)
461461
n_chains_list = [n_chains] if isinstance(n_chains, int) else n_chains
462462
total_chains = np.sum(n_chains_list)
463463

@@ -480,6 +480,7 @@ def __call__(
480480
seed=seed,
481481
**pins,
482482
)
483+
seed = [x + 1 for x in seed]
483484
except tf.errors.ResourceExhaustedError as error:
484485
raise MCMCOOMError(
485486
"ERROR: Out of memory. Try reducing `n_keep` or pass a list of"

pyproject.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ dependencies = [
3030
"altair >= 5",
3131
"immutabledict",
3232
"joblib",
33-
"numpy >= 1.26, < 2",
34-
"pandas >= 2.2, < 3",
35-
"scipy >= 1.12.0, < 1.13",
36-
"tensorflow >= 2.16, < 2.17",
37-
"tensorflow-probability >= 0.24, < 0.25",
38-
"tf-keras >= 2.16, < 2.17",
33+
"numpy >= 2.0.2, < 3",
34+
"pandas >= 2.2.2, < 3",
35+
"scipy >= 1.13.1, < 2",
36+
"tensorflow >= 2.18, < 2.19",
37+
"tensorflow-probability >= 0.25, < 0.26",
38+
"tf-keras >= 2.18, < 2.19",
3939
"xarray",
4040
]
4141

@@ -65,7 +65,7 @@ colab = [
6565
# GPU deps
6666
# Installed through `pip install -e .[and-cuda]`
6767
and-cuda = [
68-
"tensorflow[and-cuda] >= 2.16, < 2.17",
68+
"tensorflow[and-cuda] >= 2.18, < 2.19",
6969
]
7070

7171
[tool.pyink]

0 commit comments

Comments
 (0)