Skip to content

Issue on page /tutorials/means.html #78

Description

@cranmer

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.

Activity

  1. cranmer commented on Mar 31, 2022

    @cranmer
    Author

    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 :-)

  2. cranmer commented on Mar 31, 2022

    @cranmer
    Author

    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

  3. dfm commented on Mar 31, 2022

    @dfm
    Owner

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

  4. added
    documentationImprovements or additions to documentation
    on Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions