Closed ricardoV94 closed 1 year ago
Hey, I would like to work on this issue, is it available?
Yes, feel free to take it
I am new to this field, can you please guide me on this?
You will want to:
pymcx
with pymc_experimental
Hope that helps. Feel free to ask if you have additional questions.
In case you need to set up your virtual environment, there are some instructions here:
https://pymc-data-umbrella.xyz/en/latest/sprint/tutorials/environment_setup.html
The virtual environment will be helpful for running the notebook after the changes have been made to see that they work, error free
Where is this "pymcx"?, I am unable to find it,
It doesn't exist, which is why we have to change it.
Specifically, we renamed pymcx to pymc-experimental
, which is what you have to do here. https://github.com/pymc-devs/pymc-experimental/
This page is a useful guide https://pymc-data-umbrella.xyz/en/latest/sprint/tutorials/docstring_tutorial.html
And the style guide is useful to consult if you run into any issues https://docs.pymc.io/en/latest/contributing/jupyter_style.html
code:
import arviz as az
import numpy as np
import pymc as pm
import pymc_experimental as pmx
import pytensor
import pytensor.tensor as pt
print(f"Running on PyMC v{pm.__version__}")
with model:
idata = pmx.fit(method="pathfinder")
Error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
File ~/miniforge3/envs/pymc-dev/lib/python3.11/site-packages/pymc_experimental/inference/fit.py:34, in fit(method, **kwargs)
33 try:
---> 34 from pymc_experimental.inference.pathfinder import fit_pathfinder
35 except ImportError as exc:
File ~/miniforge3/envs/pymc-dev/lib/python3.11/site-packages/pymc_experimental/inference/pathfinder.py:21
20 import arviz as az
---> 21 import blackjax
22 import jax
ModuleNotFoundError: No module named 'blackjax'
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Cell In[3], line 2
1 with model:
----> 2 idata = pmx.fit(method="pathfinder")
File ~/miniforge3/envs/pymc-dev/lib/python3.11/site-packages/pymc_experimental/inference/fit.py:36, in fit(method, **kwargs)
34 from pymc_experimental.inference.pathfinder import fit_pathfinder
35 except ImportError as exc:
---> 36 raise RuntimeError("Need BlackJAX to use `pathfinder`") from exc
37 return fit_pathfinder(**kwargs)
RuntimeError: Need BlackJAX to use `pathfinder`
jax installation:
https://github.com/google/jax#installation
blackjax installation: https://pypi.org/project/blackjax/
Closed by #521.
We decided to keep the long name for the library, so the example should be updated.
CC @twiecki