Skip to content

fix: bump pypress to v0.2.4 for scale-invariant entropy penalty - #26

Merged
gmgeorg merged 2 commits into
mainfrom
fix/pypress-scale-invariant-entropy-penalty
Aug 27, 2026
Merged

gmgeorg merged 2 commits into
mainfrom
fix/pypress-scale-invariant-entropy-penalty

Conversation

@gmgeorg

@gmgeorg gmgeorg commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bumps pypress to v0.2.4, which fixes TargetEntropy/Uniform (pypress.keras.regularizers) not being scale-invariant in K (the number of predictive states) — the squared entropy deviation had a dynamic range that grew as log(K)^2, so a fixed l2 implied a different effective regularization strength depending on K.
  • pypress v0.2.4 also changed DegreesOfFreedom from an L1 to a squared L2 penalty, renaming its l1/dof_l1 params to l2/dof_l2. Updated all pypsps call sites, including renaming the public df_penalty_l1 parameter (in pypsps/keras/models.py) to df_penalty_l2, and the two demo notebooks that passed it by keyword.
  • This is a breaking rename for any caller passing df_penalty_l1 by keyword.

Test plan

  • pytest pypsps/tests — 93 passed
  • Verified pypsps.keras.models, models_dev, models_dev2, models_dev_exp all import cleanly

🤖 Generated with Claude Code

gmgeorg and others added 2 commits August 27, 2026 13:43
pypress v0.2.4 makes TargetEntropy/Uniform's penalty scale-invariant in K
(the number of predictive states) by normalizing the entropy deviation by
log(K) before squaring, instead of letting the penalty's dynamic range grow
as log(K)^2.

That release also changed DegreesOfFreedom from an L1 to a squared L2
penalty, renaming its l1/dof_l1 params to l2/dof_l2. Updated all pypsps call
sites, including renaming the public df_penalty_l1 parameter (in
pypsps/keras/models.py's build_toy_model, build_model_binary_normal,
build_model_binary_exponential, etc.) to df_penalty_l2, and the two demo
notebooks that passed it by keyword.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gmgeorg
gmgeorg merged commit 265963e into main Aug 27, 2026
1 check passed
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