Skip to content

ENH: Add pcf_penalty_from_latents to reuse an existing encoding. - #19

Merged
ntustison merged 1 commit into
mainfrom
pcf_reg3
Nov 12, 2026
Merged

ntustison merged 1 commit into
mainfrom
pcf_reg3

Conversation

@ntustison

Copy link
Copy Markdown
Member

pcf_penalty_from_latents(x, z, log_det, num_dims=1, create_graph=True) computes the principal component flow penalty from an encoding already computed with x.requires_grad, so that a training forward pass can share one encoder pass between the likelihood and the penalty (and run inside a DistributedDataParallel forward). pcf_penalty now calls it; values are unchanged.

pcf_penalty_from_latents(x, z, log_det, num_dims=1, create_graph=True)
computes the principal component flow penalty from an encoding already
computed with x.requires_grad, so that a training forward pass can share
one encoder pass between the likelihood and the penalty (and run inside
a DistributedDataParallel forward). pcf_penalty now calls it; values are
unchanged.
@ntustison
ntustison merged commit 232f03f into main Nov 12, 2026
4 checks passed
@ntustison
ntustison deleted the pcf_reg3 branch November 12, 2026 22:54
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.

1 participant