Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GP-Latent.ipynb to v4 #413

Merged
merged 5 commits into from
Oct 10, 2022
Merged

Conversation

bwengals
Copy link
Collaborator

@bwengals bwengals commented Aug 9, 2022

Update GP-Latent.ipynb to V4

This notebook was previously merged (see discussion in #371) but was overwritten. This PR re-adds it.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB


+++

The `gp.Latent` class is a direct implementation of a Gaussian process without approximation. Given a mean and covariance function, we can place a prior on the function $f(x)$,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `gp.Latent` class is a direct implementation of a Gaussian process without approximation. Given a mean and covariance function, we can place a prior on the function $f(x)$,
The {class}`pymc.gp.Latent` class is a direct implementation of a Gaussian process without approximation. Given a mean and covariance function, we can place a prior on the function $f(x)$,

I would use this so it is rendered as a link. And not related here but I'd also update the docstring of the class so it links to this notebook. If you add :ref:`nb:gp_latent` somewhere on the docstring, the link to this notebook will be added, expanding that target as the title of the page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is very cool. Is this the page to read about how this works? https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#the-ref-role

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is a good reference

@review-notebook-app
Copy link

review-notebook-app bot commented Aug 9, 2022

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-08-09T04:13:12Z
----------------------------------------------------------------

Line #8.    f_post = idata.posterior["f"].stack(samples=["chain", "draw"]).T

If you use the current arviz development version you can do

f_post = az.extract(idata, var_names="f").transpose("sample", ...)

I assume plot_pg_dist wants the sample dimension to be the first one.



bwengals commented on 2022-09-28T19:14:32Z
----------------------------------------------------------------

Yup it does. plot_gp_dist really needs to be updated to work with InferenceData objects. Really like az.extract, though I have to brag that I'm pretty fast now at typing idata.posterior.thing.stack(sample=['chain', 'draw'])

@review-notebook-app
Copy link

review-notebook-app bot commented Aug 9, 2022

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-08-09T04:13:13Z
----------------------------------------------------------------

can you add a watermark title right above the watermark code cell? and the -p aesara,aeppl,xarray flag. Ref: https://www.pymc.io/projects/docs/en/stable/contributing/jupyter_style.html


bwengals commented on 2022-09-28T19:13:09Z
----------------------------------------------------------------

Ah yup, added

Copy link
Collaborator Author

Ah yup, added


View entire conversation on ReviewNB

Copy link
Collaborator Author

Yup it does. plot_gp_dist really needs to be updated to work with InferenceData objects. Really like az.extract, though I have to brag that I'm pretty fast now at typing idata.posterior.thing.stack(sample=['chain', 'draw'])


View entire conversation on ReviewNB

@OriolAbril OriolAbril merged commit a384f35 into pymc-devs:main Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants