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

Add introductory kernel notebook and change style file path in notebooks #331

Merged

Conversation

Thomas-Christie
Copy link
Contributor

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other - New notebook.

Checklist

  • I've formatted the new code by running poetry run pre-commit run --all-files --show-diff-on-failure before committing.
  • I've added tests for new code.
  • I've added docstrings for the new code.

Description

Main change is to add a notebook introducing the concept of a kernel for those new to Gaussian processes. This focuses on mathematical intuition and introduces useful concepts such as covariance matrices and positive-definiteness.

Also noted that the README file for writing documentation hadn't been updated since switching to using MkDocs, so updated it to reflect these changes.

Also found that the relative path to the style file for the notebooks caused issues when running the poetry run mkdocs serve command. Now instead of using a relative path to the style file, we point to the URL of the style file directly. I have copied the style file into the _static directory, and a future PR will point to this URL instead.

Finally made a few other minor edits:

  • Updated docstring for the periodic kernel as it was incomplete.
  • Made some minor fixes to a few other docstrings I found flaws in.
  • Bumped up KaTeX version from 0.9.0 to 0.16.8 in mkdocs.yml file.

Issue Number: #269

Main change is to add a notebook introducing the concept of a kernel for
those new to Gaussian processes. This focuses on mathematical intuition
and introduces useful concepts such as covariance matrices and
positive-definiteness.

Also noted that the README file for writing documentation hadn't been
updated since switching to using MkDocs, so updated it to reflect these
changes.

Also found that the relative path to the style file for the notebooks
caused issues when running the `poetry run mkdocs serve` command. Now
instead of using a relative path to the style file, we point to the URL
of the style file directly. I have copied the style file into the
`_static` directory, and a future PR will point to this URL instead.

Finally made a few other minor edits:
- Updated docstring for the periodic kernel as it was incomplete.
- Made some minor fixes to a few other docstrings I found flaws in.
Copy link
Collaborator

@thomaspinder thomaspinder left a comment

Choose a reason for hiding this comment

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

Really nice work @Thomas-Christie! I've left comments.

nit: can you make all markdown lines 88 characters long please? It makes reviewing much easier. Most code editors will have a hard wrap option that should automate this for you.

docs/examples/README.md Show resolved Hide resolved
docs/examples/README.md Outdated Show resolved Hide resolved
docs/examples/intro_to_kernels.py Show resolved Hide resolved
docs/examples/intro_to_kernels.py Outdated Show resolved Hide resolved
docs/examples/intro_to_kernels.py Outdated Show resolved Hide resolved
docs/examples/intro_to_kernels.py Outdated Show resolved Hide resolved
docs/examples/intro_to_kernels.py Show resolved Hide resolved
docs/examples/intro_to_kernels.py Outdated Show resolved Hide resolved
docs/examples/intro_to_kernels.py Show resolved Hide resolved
docs/examples/intro_to_kernels.py Show resolved Hide resolved
@Thomas-Christie
Copy link
Contributor Author

Thanks a lot for the detailed feedback @thomaspinder . I have addressed your comments in a new commit.

@Thomas-Christie
Copy link
Contributor Author

Minor commit added - had forgotten to add the reference for the Matérn kernel.

@henrymoss henrymoss self-requested a review July 6, 2023 14:27
@thomaspinder
Copy link
Collaborator

Approved. I can see @henrymoss has added himself as a reviewer. Once his review cycle is complete, I am happy for this to be merged.

@thomaspinder thomaspinder added the documentation Improvements or additions to documentation label Jul 7, 2023
@thomaspinder thomaspinder added this to the v1.0.0 milestone Jul 7, 2023
Copy link
Contributor

@henrymoss henrymoss left a comment

Choose a reason for hiding this comment

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

Great work Tom. Really nice noteobook. I've left a couple of comments. I think we might as well show off some Sum / Products or kernels here

@henrymoss
Copy link
Contributor

Also, now that we have an introductory kernel notebook, shall we rename the existing kernels.py to building_new_kernels.py or something similar?

@Thomas-Christie
Copy link
Contributor Author

Also, now that we have an introductory kernel notebook, shall we rename the existing kernels.py to building_new_kernels.py or something similar?

I have renamed the file to constructing_new_kernels.py and all references to the file.

Added an extra section to the kernel introduction notebook detailing how
one can create new kernels by adding/multiplying two existing kernels.
Also added an example using the Mauna Loa CO2 dataset.

Also renamed the original 'kernels.py' notebook to
'constructing_new_kernels.py' and edited references to this notebook.
@Thomas-Christie
Copy link
Contributor Author

@henrymoss @thomaspinder thanks for the feedback. I have addressed Henry's feedback, adding a section using the Mauna Loa CO2 dataset and a section on composing new kernels through addition/multiplication of existing kernels. I have also moved the section on Gram matrices etc. closer to the start.

Have also renamed the original 'kernels.py' notebook to 'constructing_new_kernels.py' for clarity (and have renamed references to this file).

Are you happy for me to merge this now?

@Thomas-Christie Thomas-Christie merged commit ce40904 into JaxGaussianProcesses:main Jul 10, 2023
@Thomas-Christie Thomas-Christie deleted the kernel-notebook branch July 10, 2023 08:40
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

Successfully merging this pull request may close these issues.

3 participants