Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions bletl/growth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib.util
import logging
from typing import Dict, Optional, Sequence, Tuple, Union

Expand Down Expand Up @@ -131,14 +132,25 @@
**sample_kwargs
optional keyword-arguments to pymc.sample(...) to override defaults
"""
sample_kwargs = dict(
return_inferencedata=True,
target_accept=0.95,
init="adapt_diag",
initvals=self.theta_map,
tune=500,
draws=500,
)
if importlib.util.find_spec("nutpie"):
sample_kwargs = dict(

Check warning on line 136 in bletl/growth.py

View check run for this annotation

Codecov / codecov/patch

bletl/growth.py#L135-L136

Added lines #L135 - L136 were not covered by tests
return_inferencedata=True,
target_accept=0.95,
nuts_sampler="nutpie",
init="adapt_diag",
init_means=self.theta_map,
tune=500,
draws=500,
)
else:
sample_kwargs = dict(

Check warning on line 146 in bletl/growth.py

View check run for this annotation

Codecov / codecov/patch

bletl/growth.py#L146

Added line #L146 was not covered by tests
return_inferencedata=True,
target_accept=0.95,
init="adapt_diag",
initvals=self.theta_map,
tune=500,
draws=500,
)
sample_kwargs.update(kwargs)
with self.pmodel:
self._idata = pm.sample(**sample_kwargs)
Expand Down
Loading