Skip to content

Conversation

@gw265981
Copy link
Contributor

@gw265981 gw265981 commented Mar 18, 2025

PR Type

  • Bugfix
  • Feature

Description

Improving the performance of Stein Thinning in benchmarks, primarily by using regularisation and better probability density estimation.

How Has This Been Tested?

Existing tests pass as expected.

Does this PR introduce a breaking change?

Checklist before requesting a review

  • I have made sure that my PR is not a duplicate.
  • My code follows the style guidelines of this project.
  • I have ensured my code is easy to understand, including docstrings and comments where necessary.
  • I have performed a self-review of my code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.
  • I have updated CHANGELOG.md, if appropriate.

@github-actions
Copy link
Contributor

Performance review

Commit 5dee5cd - Merge 41fcd48 into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit 6e21644 - Merge ed405a3 into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit b319566 - Merge 70dc93e into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit fe14875 - Merge 6c78ac9 into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit f20278d - Merge 822df59 into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit 8bbbae2 - Merge 10000f9 into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit c4f46f1 - Merge 9b4f97f into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit e192a1a - Merge 4954ba6 into 6ed8e9d

No significant changes to performance.

@gw265981
Copy link
Contributor Author

List of all changes:

  • Replace the score function for Stein Thinning in blobs_benchmark.py and benchmark_util.py (and so for other benchmarks) with jax.scipy.stats.gaussian_kde(). Also set regularisation to True.
  • Add a parameter kde_bw_method to the SteinThinning solver which is passed to jax.scipy.stats.gaussian_kde() when estimating probability density for regularisation.
  • Small updates to benchmarks, including making sure the saving paths are correct, fixing random state of UMAP for reproducibility, reducing UMAP dimension for the pounce benchmark.
  • Rerun all the benchmarks and update the benchmarking.rst page.
  • Add test to test_benchmark.py to run the initialised SteinThinning solver.

@gw265981 gw265981 marked this pull request as ready for review March 20, 2025 09:09
@gw265981
Copy link
Contributor Author

Also addressed #992, #985. For the alt text, I left it unchanged for the blobs benchmark charts since raw data is provided.

@github-actions
Copy link
Contributor

Performance review

Commit 773e7b3 - Merge a90dfc9 into 6ed8e9d

No significant changes to performance.

@rg936672 rg936672 self-requested a review March 20, 2025 11:11
Copy link
Contributor

@rg936672 rg936672 left a comment

Choose a reason for hiding this comment

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

Looks good, just a few minor suggestions. Remember to link the issues that this PR closes, either under "Development" at the top right, or by using "Closes #xyz" in the issue description.

Co-authored-by: rg936672 <162452529+rg936672@users.noreply.github.com>
@github-actions
Copy link
Contributor

Performance review

Commit 0e2a402 - Merge a4b560f into 6ed8e9d

No significant changes to performance.

@github-actions
Copy link
Contributor

Performance review

Commit c6280fd - Merge 12614e0 into 6ed8e9d

No significant changes to performance.

rg936672
rg936672 previously approved these changes Mar 20, 2025
Copy link
Contributor

@rg936672 rg936672 left a comment

Choose a reason for hiding this comment

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

I'm happy my suggestions have all been addressed, though hold off on merging until both (a) @pc532627 approves as well and (b) you've created a ticket for any suggestions that you've deemed out of scope for this PR. (Could be as simple as a "Clean up benchmarking code" with a link to the review comments in question.)

@pc532627 pc532627 self-requested a review March 20, 2025 15:09
Copy link
Contributor

@pc532627 pc532627 left a comment

Choose a reason for hiding this comment

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

One minor typo

@github-actions
Copy link
Contributor

Performance review

Commit 388fea6 - Merge 31bfe2e into 6ed8e9d

No significant changes to performance.

@rg936672
Copy link
Contributor

TODO failure is a bug in the latest Ruff - see astral-sh/ruff#16874

@pc532627 pc532627 self-requested a review March 20, 2025 17:33
@pc532627 pc532627 merged commit c7fe19d into main Mar 20, 2025
22 of 24 checks passed
@pc532627 pc532627 deleted the bugfix/investigate-stein-thinning branch March 20, 2025 17:34
rg936672 added a commit that referenced this pull request Mar 21, 2025
These have been fixed by the changes in #1000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants