Progressively freeze model stage parameters during training.
Details
A luz callback that sets requires_grad = FALSE on the parameters of
specified model components at defined epoch boundaries. Multiple freeze
actions at different epochs are supported via the schedule argument.
Once frozen, a component's parameters receive no gradient and are not
updated by the optimizer for the remainder of training.
Component names must match the submodule field names used inside the model.
For defineUNet and defineUNet3p the stage names are
"e1", "e2", "e3", "e4", "btn",
"d1", "d2", "d3", "d4". For
defineMobileUNet and defineEfficientUNetB2 there are five
encoder stages ("e1" through "e5") and five decoder stages
("d1" through "d5"). Attention gate and squeeze-and-excitation
submodules ("ag1", "se1", etc.) can also be named.
Freezing takes effect at the end of the specified epoch, so frozen components are inactive from the following epoch onward. A message is printed each time a component is frozen, reporting the component name and parameter count.
