Repository navigation
Conversation
… flows. Move the PCF penalty to antsnormflows.utils.pcf_penalty(model, x, num_dims=1, context=None, create_graph=None), which works for any flow with inverse_and_log_det: NormalizingFlow, ConditionalNormalizingFlow (Jacobian at fixed context), MultiscaleFlow and ConvFlow1d. MultiscaleFlow.pcf_regularizer now delegates to it (same interface and values). Layers that use batch statistics in training mode (nn.BatchNorm*, flow BatchNorm with detach_stats=False) are rejected, since one vector-Jacobian product serves the whole batch. Tests: exact values against the full Jacobian for RealNVP, a conditional MAF and ConvFlow1d; unbiased stochastic estimate; delegation; BatchNorm rejection; finite gradients.
Member
Author
|
Hey @stnava, here's another topic for discussion next week. I think you'd be interested and it would be useful to get your insight. |
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.
…e flows.
Move the PCF penalty to antsnormflows.utils.pcf_penalty(model, x, num_dims=1, context=None, create_graph=None), which works for any flow with inverse_and_log_det: NormalizingFlow, ConditionalNormalizingFlow (Jacobian at fixed context), MultiscaleFlow and ConvFlow1d. MultiscaleFlow.pcf_regularizer now delegates to it (same interface and values). Layers that use batch statistics in training mode (nn.BatchNorm*, flow BatchNorm with detach_stats=False) are rejected, since one vector-Jacobian product serves the whole batch.
Tests: exact values against the full Jacobian for RealNVP, a conditional MAF and ConvFlow1d; unbiased stochastic estimate; delegation; BatchNorm rejection; finite gradients.