Skip to content

Enforce consistent policy for parameter freezing - #456

Open
nkbranigan wants to merge 1 commit into
probml:mainfrom
nkbranigan:check_trainable
Open

Enforce consistent policy for parameter freezing#456
nkbranigan wants to merge 1 commit into
probml:mainfrom
nkbranigan:check_trainable

Conversation

@nkbranigan

Copy link
Copy Markdown
Collaborator

Summary

Details

  • The policy I’m suggesting:
    • When using EM with a closed-form M-step: HMMs can freeze all or no emission parameters (and independently freeze the initial and transition parameters in any combination — no change to this behavior), and LGSSMs can freeze all or no parameters
    • Unsupported freezes raise, with instruction to use fit_sgd, which supports any combination of frozen parameters
  • Future PRs could relax this policy
    • HMMs: Could support updates for specific combinations of frozen emission parameters (new math needed)
    • LGSSM: Could support updates for blocks of parameters (no new math needed)
  • There should be no performance impact from this change
    • The new guards run entirely at trace time (trainable is static), so EM's XLA programs are identical before and after this PR when all parameters are trainable (verified by comparing jaxpr for all 9 affected models)
  • I have tried to keep functional changes to a minimum (this PR is 58% whitespace / indentation and 28% tests)

- Fitting some models with EM silently ignores `trainable=False`. Further, the models that do respect the flag disagree on the policy: for example, the GMM HMMs reject freezing all emission parameters while `GaussianHMM` allows it.
- New policy:
    - When using EM with a closed-form M-step: HMMs can freeze all or no emission parameters (and independently freeze the initial and transition parameters in any combination — no change to this behavior), and LGSSMs can freeze all or no parameters
    - Unsupported freezes raise, with instruction to use `fit_sgd`, which supports any combination of frozen parameters
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.

m_step for LinearRegressionHMMEmissions and DiagonalGaussianHMMEmissions does not check whether parameters are trainable

1 participant