pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

log gaussian cox process

Open OriolAbril opened this issue 3 years ago • 6 comments

File: https://nbviewer.jupyter.org/github/pymc-devs/pymc-examples/blob/main/examples/case_studies/log-gaussian-cox-process.ipynb Reviewers: @ckrapu

Context

Known changes needed

Changes listed in this section should all be done at some point in order to get this notebook to a "Best Practices" state. However, these are probably not enough! Make sure to thoroughly review the notebook and search for other updates.

General updates

  • use numpy Generator. See also https://numpy.org/doc/stable/reference/random/index.html?highlight=random%20sampling%20numpy%20random#quick-start

Changes for discussion

Changes listed in this section are up for discussion, these are ideas on how to improve the notebook but may not have a clear implementation, or fix some know issue only partially.

ArviZ related

  • Use xarray and from_pymc3_predictions to filter nans and slice/reduce intensity_samples

Notes

Exotic dependencies

None

Computing requirements

Model takes roughly 5 mins to sample.

OriolAbril avatar Mar 29 '21 03:03 OriolAbril

@ckrapu, feel free to decline. We are currently trying to update all the notebooks to make sure they follow pymc3 best practices and then have them run on pymc3 4.0+. We are tracking our progress in this project, it has a detailed description here. We submitted a project proposal to outreachy to have some extra help with that and therefore have a smooth transition from pymc3 v3 to pymc3 v4 with great docs on v4.

OriolAbril avatar Mar 29 '21 03:03 OriolAbril

No problem, I'm cleaning it up as we speak. This was a good chance for me to clean up the priors in the notebook so that there wouldn't be any need to filter out bad samples from the posterior for the gaussian process. As an aside, do you know how to suppress this warning? It's showing up 10-15 times per usage of sample.

/Users/v7k/anaconda3/envs/pymc3_dev/lib/python3.8/site-packages/aesara/graph/fg.py:500: UserWarning: Variable Elemwise{pow,no_inplace}.0 cannot be replaced; it isn't in the FunctionGraph

ckrapu avatar Mar 30 '21 02:03 ckrapu

It looks like you are using aesara already which may be a bit too early (as pymc3 backend), which pymc3 versions are you using?

OriolAbril avatar Mar 30 '21 07:03 OriolAbril

I'd been using 3.11.1. Should I run a version that's backed by Theano?

ckrapu avatar Apr 01 '21 23:04 ckrapu

3.11.1 should run on theano-pymc, not yet on aesara. Here is the link to it's requirements file: https://github.com/pymc-devs/pymc3/blob/v3.11.1/requirements.txt

OriolAbril avatar Apr 02 '21 00:04 OriolAbril

I must have gotten my environments mixed up, then. Let me try with a clean conda env.

ckrapu avatar Apr 02 '21 00:04 ckrapu