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

Fixed Polar GP example #339

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

trsav
Copy link
Contributor

@trsav trsav commented Jul 29, 2023

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

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

Please describe your changes here. If this fixes a bug, please link to the issue, if possible.

Polar GP example was non-continuous through 0 - 2\pi. When defining the half-period constant c as follows:

    period: float = static_field(2 * jnp.pi)
    tau: float = param_field(jnp.array([4.0]), bijector=bij)

    def __post_init__(self):
        self.c = self.period / 2.0

c was still training as a parameter during optimisation and wasn't being considered static, resulting in an invalid Polar GP (I believe). Therefore I moved the definition of c to within the call method of the kernel, maintaining it as a constant during hyper-parameter optimisation. I'm not 100% sure on why this behaviour is happening, with training a constant, but this fixes it.

I have changed the docs to reflect this, also fixed a minor typo (circular_posterior), and changed linewidth of the fill_between to be 0 so there wasn't a funky line between 0 and 2/pi.

Issue Number: N/A

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into GPJax!

If you have not heard from us in a while, please feel free to ping @gpjax/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on Slack for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@thomaspinder thomaspinder merged commit 1c80261 into JaxGaussianProcesses:main Jul 31, 2023
19 checks passed
@trsav trsav deleted the polar-fix-feature branch August 6, 2023 19:55
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.

None yet

2 participants