Debug message for scalar values fails
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 9.8k
- Forks
- 2.3k
- Avg merge
- 21h 39m
- Merged PRs (30d)
- 5
Description
raises an error when variable is scalar
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[23], line 1
----> 1 model.debug(fn="dlogp")
File [/dev/pymc/pymc/model/core.py#line=1965), in Model.debug(self, point, fn, verbose)
1962 print_(
1963 f"Some of the{observed}values of variable {rv} are associated with a non-finite {fn}:"
1964 )
1965 mask = ~np.isfinite(rv_fn_eval)
-> 1966 for value, fn_eval in zip(values[mask], rv_fn_eval[mask]):
1967 print_(f" value = {value} -> {fn} = {fn_eval}")
1968 print_()
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pymc/model/core.py around line 1966 and reproduce Model.debug(fn="dlogp") with a scalar variable. Inspect the reported indexing failure and verify that debugging scalar values completes without IndexError while still printing non-finite values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100