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

[WIP] Equivalence tests #6

Merged
merged 6 commits into from
Jul 14, 2021
Merged

[WIP] Equivalence tests #6

merged 6 commits into from
Jul 14, 2021

Conversation

rossviljoen
Copy link
Collaborator

Adds tests which check the equivalence of certain models.

For example, sparse models with inducing inputs == training inputs should recover the exact GP posterior.

@rossviljoen rossviljoen changed the title Equivalence tests [WIP] Equivalence tests Jul 4, 2021
@rossviljoen rossviljoen mentioned this pull request Jul 6, 2021
2 tasks
@rossviljoen rossviljoen linked an issue Jul 6, 2021 that may be closed by this pull request
2 tasks
Comment on lines 115 to 116
@test all(isapprox.(mean(gpr_post, x), mean(svgp_post, x), atol=1e-3))
@test all(isapprox.(cov(gpr_post, x), cov(svgp_post, x), atol=1e-3))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The current state of this is:

Testing equivalence of the exact and sparse mean and cov works (with a fairly large tolerance of 1e-3) when only optimising the sparse variational posterior. Optimising kernel parameters at the same time does not give consistent enough behaviour - possibly need to use a different optimiser?

Copy link
Member

Choose a reason for hiding this comment

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

Before investigating this further, how about one step simpler - set z=x and then we can determine analytically what we need to set q to for it to be exactly equivalent to GPR (then it should be equal within a very tight tolerance at most ~1e-8 or so in double precision).

@rossviljoen rossviljoen deleted the branch base_implementation July 10, 2021 00:41
@rossviljoen rossviljoen reopened this Jul 10, 2021
@rossviljoen rossviljoen changed the base branch from master to base_implementation July 10, 2021 01:03
@rossviljoen rossviljoen mentioned this pull request Jul 14, 2021
@rossviljoen rossviljoen marked this pull request as ready for review July 14, 2021 12:14
@rossviljoen
Copy link
Collaborator Author

Merging into #9 to put everything in one PR

@rossviljoen rossviljoen merged commit 60d5072 into base_implementation Jul 14, 2021
@rossviljoen rossviljoen deleted the ross/tests branch July 14, 2021 12:17
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.

Testing
2 participants