prior_target_standardization
prior_target_standardization
¶
Callback for fitting learned-prior latent target standardization.
PriorTargetStandardizationCallback
¶
Bases: Callback
Fit latent target statistics for learned denoising priors.
Initialize the callback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_batches
|
int | None
|
Maximum train batches to scan when fitting stats. |
None
|
require_posterior_frozen
|
bool
|
If true, fit only after the posterior encoder has no trainable parameters. |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/versatil/training/callbacks/prior_target_standardization.py
on_train_start
¶
Fit stats if the initial training regime is already prior-only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trainer
|
Trainer
|
Active Lightning trainer. |
required |
pl_module
|
LightningModule
|
Lightning module wrapping the policy. |
required |
Source code in src/versatil/training/callbacks/prior_target_standardization.py
on_train_epoch_start
¶
Fit stats when staged training first makes the prior trainable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trainer
|
Trainer
|
Active Lightning trainer. |
required |
pl_module
|
LightningModule
|
Lightning module wrapping the policy. |
required |