Sum all video event dimensions in posterior KL divergence - #14
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
sylvesterkaczmarek
marked this pull request as ready for review
September 19, 2026 18:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sum every non-batch dimension in
DiagonalGaussianDistribution.kl(), including the channel axis of video posteriors[B, T, H, W, C]. Return one deterministic zero per batch item as well.The hardcoded
(1, 2, 3)reduction leaves a[B, C]result for video latents. Reducing that result with.mean()averages channels rather than summing the independent Gaussian contributions. In the 16-channel regression, the gradient is0.03125instead of0.5, underweighting this KL term by 16. Both standard-normal KL and KL against another posterior are affected.The four-dimensional image reduction is preserved. Posterior sampling, its mode, and inference decoding are unchanged. This intentionally changes video KL output from
[B, C]to[B].Validation
CPU, macOS arm64, Python 3.12, JAX 0.7.2, Flax 0.11.2:
9912d29, four tests fail and the image-posterior control passes.git diff --checkpassed.No pretrained-model training run or GPU execution was performed. The unpinned JAX 0.11.2/Flax 0.12.9 environment fails in Flax NNX import (
HiPrimitive) even before the patch; this PR does not change dependencies.