Skip to content

Conversation

@Red-Portal
Copy link
Member

@Red-Portal Red-Portal commented Nov 14, 2025

The objectives used in variational inference are sometimes minimized or maximized, which can be confusing. For instance the KL divergence is supposed to minimized, but the ELBO is usually maximized. Allowing this to vary on an algorithm-to-algorithm basis doesn't make a lot of sense. Therefore, this PR enforces the convention that all objective values (that are only accessible by calling estimate_objective) are expected to be minimized. For instance, for ELBO maximization algorithms, estimate_objective will return the negative ELBO.

Red-Portal and others added 8 commits November 14, 2025 15:44
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

AdvancedVI.jl documentation for PR #215 is available at:
https://TuringLang.github.io/AdvancedVI.jl/previews/PR215/

Copy link
Contributor

@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.

Benchmark Results

Benchmark suite Current: a77a4ec Previous: b14bb9f Ratio
normal/RepGradELBO + STL/meanfield/Zygote 4111928055.5 ns 3920438191 ns 1.05
normal/RepGradELBO + STL/meanfield/ReverseDiff 1143921579 ns 1137314480 ns 1.01
normal/RepGradELBO + STL/meanfield/Mooncake 1212530059 ns 1248798164 ns 0.97
normal/RepGradELBO + STL/fullrank/Zygote 4090539011.5 ns 3888598013 ns 1.05
normal/RepGradELBO + STL/fullrank/ReverseDiff 1687724094 ns 1660774838 ns 1.02
normal/RepGradELBO + STL/fullrank/Mooncake 1264704478.5 ns 1250085352 ns 1.01
normal/RepGradELBO/meanfield/Zygote 2903273540.5 ns 2775544305.5 ns 1.05
normal/RepGradELBO/meanfield/ReverseDiff 807433943 ns 780909736 ns 1.03
normal/RepGradELBO/meanfield/Mooncake 1105499181 ns 1086150808 ns 1.02
normal/RepGradELBO/fullrank/Zygote 2929161011 ns 2770044101 ns 1.06
normal/RepGradELBO/fullrank/ReverseDiff 995244863.5 ns 973336667 ns 1.02
normal/RepGradELBO/fullrank/Mooncake 1124814062 ns 1113137202 ns 1.01
normal + bijector/RepGradELBO + STL/meanfield/Zygote 5684673652 ns 5583939500 ns 1.02
normal + bijector/RepGradELBO + STL/meanfield/ReverseDiff 2511164435 ns 2408835091 ns 1.04
normal + bijector/RepGradELBO + STL/meanfield/Mooncake 4214620793.5 ns 4158213745.5 ns 1.01
normal + bijector/RepGradELBO + STL/fullrank/Zygote 5849709284 ns 5577515624 ns 1.05
normal + bijector/RepGradELBO + STL/fullrank/ReverseDiff 3169720192.5 ns 3063136975 ns 1.03
normal + bijector/RepGradELBO + STL/fullrank/Mooncake 4343776652.5 ns 4187254056 ns 1.04
normal + bijector/RepGradELBO/meanfield/Zygote 4573742532 ns 4312418628 ns 1.06
normal + bijector/RepGradELBO/meanfield/ReverseDiff 2131237741 ns 2049108141 ns 1.04
normal + bijector/RepGradELBO/meanfield/Mooncake 4068000162.5 ns 3927457037.5 ns 1.04
normal + bijector/RepGradELBO/fullrank/Zygote 4647694027 ns 4322323571 ns 1.08
normal + bijector/RepGradELBO/fullrank/ReverseDiff 2413311298 ns 2294744589 ns 1.05
normal + bijector/RepGradELBO/fullrank/Mooncake 4258594545 ns 4054198058 ns 1.05

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

Makes sense to me. I only have one docstring question to raise, and a couple of tiny phrasing points.

Red-Portal and others added 2 commits November 18, 2025 10:28
Co-authored-by: Markus Hauru <[email protected]>
Co-authored-by: Markus Hauru <[email protected]>
@Red-Portal Red-Portal requested a review from mhauru November 18, 2025 15:31
Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

LGTM

@Red-Portal Red-Portal merged commit 404f25b into main Nov 18, 2025
48 of 58 checks passed
@Red-Portal Red-Portal deleted the estimate_objective_convention branch November 18, 2025 16:57
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.

3 participants