Skip to content

Add log-density construction for Stein kernels - #1238

Open
sylvesterkaczmarek wants to merge 1 commit into
gchq:mainfrom
sylvesterkaczmarek:feature/624-stein-log-density
Open

sylvesterkaczmarek wants to merge 1 commit into
gchq:mainfrom
sylvesterkaczmarek:feature/624-stein-log-density

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Type

Feature.

Description

Fixes #624.

Add SteinKernel.from_log_density to derive the score with automatic differentiation while retaining access to the supplied density. Density parameters remain visible to JIT, differentiation and PyTree updates. The existing score-function constructor is unchanged.

How Has This Been Tested?

  • 17 focused tests passed, covering analytic scores, kernel derivatives, JIT, parameter updates, density gradients and numeric inputs.
  • Pre-commit checks passed, including Pyright and Pylint.
  • Full unit run (python -m pytest tests/unit -q): 1,751 passed, 19 skipped.
  • Final focused run (python -m pytest tests/unit/test_stein_log_density.py -q): 17 passed.
  • GPU, notebook and full integration suites were not run.

Breaking changes

None. API documentation and CHANGELOG updated.

@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review September 10, 2026 13:59
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the feature/624-stein-log-density branch from cb389ab to 3cb5bc6 Compare September 23, 2026 19:04
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the changelog conflict while preserving both upstream and #624 entries. The Stein log-density feature remains scoped to three files. All 17 focused tests pass under the current dependency set, the complete pre-commit suite passes (Ruff, Pyright, Pylint, cspell, Pyroma and formatting), and the full current unit suite passes: 1,850 passed, 19 skipped. The PR is now 0 commits behind and mergeable; fresh workflows are awaiting maintainer approval.

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

@tc85324 This remains 0 behind, mergeable and SSH-verified on the exact validated head. The Stein log-density change is still scoped to three files; all 17 focused tests pass, the full unit suite passes 1,850 tests with 19 skipped, and the complete pre-commit suite passed. The only current GitHub-side blocker is maintainer approval of the fork-triggered Actions, which are all sitting at action_required. Ready for review once those checks are allowed to run.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the feature/624-stein-log-density branch from 3cb5bc6 to 66f9376 Compare September 30, 2026 17: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.

Allow log-density function to be specified directly in SteinKernel

1 participant