tensorflow / tensorflow/probability
AttributeError: tfp.jax.vi has no attribute 'build_factored_surrogate_posterior'
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
When running the code in the following blog
and replace tfp with tfp.substrates.jax. The code fails in the step:
variational_posteriors = tfp.sts.build_factored_surrogate_posterior(
model=co2_model)
Error message:
AttributeError: module 'tensorflow_probability.substrates.jax.experimental.vi' has no attribute 'build_factored_surrogate_posterior'
Since variational inference is also used to initialize the hmc sampler, this error also fails the sts.fit_hmc() function.
@murphyk
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 with the Structural_Time_Series_Modeling_Case_Studies_Atmospheric_CO2_and_Electricity_Demand.ipynb linked in the issue and reproduce the failing tfp.substrates.jax call to tfp.sts.build_factored_surrogate_posterior. Compare the TensorFlow and JAX paths, then verify that variational initialization works and sts.fit_hmc() no longer fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100