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

Cleanup src #419

Merged
merged 10 commits into from
Nov 29, 2023
Merged

Cleanup src #419

merged 10 commits into from
Nov 29, 2023

Conversation

thomaspinder
Copy link
Collaborator

@thomaspinder thomaspinder commented Nov 28, 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

Tighten up the underlying codebase by removing aspects of the code that are either incongruent with the entire API, or introduce too much boilerplate code for their returned utility. The code being removed is deeply woven into the source code, so adding deprecations is not possible.

Notes:

  • Once approved, I'll open an issue to refactor the pathwise sampling notebook with masking removed.
  • The strict=True argument has been added to all zip calls to make Ruff compliant with Python 3.10 standards. See B905

Issue Number: N/A

@thomaspinder thomaspinder added the removal Removals and Deprecations label Nov 28, 2023
@thomaspinder thomaspinder self-assigned this Nov 28, 2023
@@ -158,6 +174,7 @@
model=posterior,
objective=jit(gpx.ConjugateMLL(negative=True)),
train_data=D,
max_iters=1000
Copy link
Contributor

Choose a reason for hiding this comment

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

did this fix it? Seems like a huge number for LBFGS

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No - the error persists. Works locally

Comment on lines +511 to +515
covariance = Ktt - jnp.matmul(Kxt.T, Sigma_inv_Kxt)
covariance += cola.ops.I_like(covariance) * self.prior.jitter
covariance = cola.PSD(covariance)
rval = GaussianDistribution(jnp.atleast_1d(mean.squeeze()), covariance)
if m == 1:
return rval
else:
return ReshapedDistribution(rval, (n_test, m))

return GaussianDistribution(jnp.atleast_1d(mean.squeeze()), covariance)
Copy link
Contributor

Choose a reason for hiding this comment

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

Readable!

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.

Nice bit of surgery Dr. Pinder

@thomaspinder thomaspinder merged commit 26aa40e into main Nov 29, 2023
13 of 14 checks passed
@thomaspinder thomaspinder deleted the cleanup_src branch November 29, 2023 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
removal Removals and Deprecations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants