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

Issue on page /tutorials/means.html #78

Open
cranmer opened this issue Mar 31, 2022 · 3 comments
Open

Issue on page /tutorials/means.html #78

cranmer opened this issue Mar 31, 2022 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@cranmer
Copy link

cranmer commented Mar 31, 2022

I should do some more work before posting an issue I guess, but I'm not sure when that's going to happen :-)

While reading the tutorial on Fitting a Mean Function](https://tinygp.readthedocs.io/en/stable/tutorials/means.html) I see a few places focusing on vmap and making the mean a function of a single input coordinate. For example:

we must define our mean function to operate on a single input coordinate. What that means is that we don’t need to worry about broadcasting and stuff within our mean function: tinygp will do all the necessary vmap-ing. More explicitly, if we try to call our mean_function on a vector of inputs

Before playing around with the code I find this confusing. I get that if we have a several data points x_i with i=1...N that we would want to vmap that. But if each x_i is a D-dim vector, then I would expect the mean function to depend on all D components of x_i. The way I interpret "single input coordinate" is one of the D components of a single input point x_i. I wonder if what is meant here is "single input data point". With the D=1 example it's hard to tell.

PS: I love the point here

It is quite common in the GP literature to (“without lack of generality”) set the mean of the process to zero and call it a day.

suggest

It is quite common in the GP literature to set the mean of the process to zero (“without lack of generality”) and call it a day.

@cranmer
Copy link
Author

cranmer commented Mar 31, 2022

other minor comment on this page. Plot has "GP model" and "mean model" as if the mean isn't part of the GP. I get what you mean here, but I do feel like the mean is part of the GP and not recognizing it that way is furthering the “without lack of generality” lore :-)

@cranmer
Copy link
Author

cranmer commented Mar 31, 2022

Noting now that "single input" would align better with

One very important thing to note here is that evaluate will always be called via vmap, so you should write your evaluate method to operate on a single pair of inputs and let vmap handle the broadcasting sematics for you.

found in https://tinygp.readthedocs.io/en/stable/tutorials/kernels.html

@dfm
Copy link
Owner

dfm commented Mar 31, 2022

yes! I agree with all of these comments and suggestions. I'll incorporate them soon. Thanks!!

@dfm dfm added the documentation Improvements or additions to documentation label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants